{"record":{"id":"14954d9da2861225","repo":"remotion-dev/remotion","slug":"shutdownstudio-is-not-supported-in-browser-studi","errorCode":null,"errorMessage":"shutDownStudio() is not supported in Browser Studio","messagePattern":"shutDownStudio\\(\\) is not supported in Browser Studio","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/api/shut-down-studio.ts","lineNumber":17,"sourceCode":"/**\n * @description Shuts down the Remotion Studio.\n * @see [Documentation](https://www.remotion.dev/docs/studio/shut-down-studio)\n */\n\nimport type {ShutdownStudioResponse} from '@remotion/studio-shared';\nimport {getRemotionEnvironment} from 'remotion';\nimport {callApi} from '../components/call-api';\nimport {getBrowserStudioOperations} from '../helpers/browser-studio-operations';\n\nexport const shutDownStudio = (): Promise<ShutdownStudioResponse> => {\n\tif (!getRemotionEnvironment().isStudio) {\n\t\tthrow new Error('shutDownStudio() is only available in the Studio');\n\t}\n\n\tif (getBrowserStudioOperations() !== null) {\n\t\tthrow new Error('shutDownStudio() is not supported in Browser Studio');\n\t}\n\n\tif (window.remotion_isReadOnlyStudio) {\n\t\tthrow new Error('shutDownStudio() is not available in read-only Studio');\n\t}\n\n\treturn callApi('/api/shutdown-studio', {});\n};\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/api/shut-down-studio.ts#L1-L26","documentation":"The Browser Studio (Studio running purely in a hosted browser context) does not implement the shutdown-studio operation, so shutDownStudio() rejects calls there. Only the locally-running Studio server can be shut down via this API.","triggerScenarios":"Calling shutDownStudio() while getBrowserStudioOperations() !== null, i.e. inside the Browser Studio build of the Studio UI.","commonSituations":"Shared Studio components/panels whose code executes both in the desktop/local Studio and the hosted Browser Studio; extensions or plugins calling the API unconditionally.","solutions":["Check getBrowserStudioOperations() !== null and skip/hide the shutdown control in Browser Studio","Only expose shutDownStudio() UI in the local Studio build","Handle the thrown error and show a 'not supported here' message to the user"],"exampleFix":"// before\nawait shutDownStudio();\n// after\nimport {getBrowserStudioOperations} from '../helpers/browser-studio-operations';\nif (getBrowserStudioOperations() === null) {\n  await shutDownStudio();\n}","handlingStrategy":"type-guard","validationCode":"import {getBrowserStudioOperations} from '../helpers/browser-studio-operations';\nconst canShutdown = getBrowserStudioOperations() === null;","typeGuard":"const isLocalStudio = (): boolean => getBrowserStudioOperations() === null;","tryCatchPattern":"try {\n  await shutDownStudio();\n} catch (e) {\n  if ((e as Error).message.includes('Browser Studio')) {\n    // hide shutdown UI or notify user\n  } else { throw e; }\n}","preventionTips":["Feature-detect Browser Studio before showing shutdown controls","Keep Studio API calls behind environment checks","Test shared Studio panels in both local and Browser Studio builds"],"tags":["studio","environment","browser","api-misuse"],"backgroundTag":"unsupported-operation","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}