{"record":{"id":"de49896b0588ebaa","repo":"remotion-dev/remotion","slug":"shutdownstudio-is-not-available-in-read-only-stu","errorCode":null,"errorMessage":"shutDownStudio() is not available in read-only Studio","messagePattern":"shutDownStudio\\(\\) is not available in read-only Studio","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/api/shut-down-studio.ts","lineNumber":21,"sourceCode":" * @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":3,"sourceCodeEnd":26,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/api/shut-down-studio.ts#L3-L26","documentation":"shutDownStudio() refuses to run outside the interactive Remotion Studio. The function first checks getRemotionEnvironment().isStudio and throws this sentinel error when called in a rendered video, the preview server, or other non-Studio runtimes, because there is no Studio process to shut down. Guard the call or only invoke it from Studio-side code.","triggerScenarios":"Calling shutDownStudio() inside a read-only Studio (window.remotion_isReadOnlyStudio === true), such as a preview link or shared sandbox Studio.","commonSituations":"Opening a hosted read-only Studio link and invoking shutdown from a custom panel/plugin; running shared Studio extensions that assume a local writable Studio.","solutions":["Check window.remotion_isReadOnlyStudio before calling shutDownStudio() and disable the UI","Wrap the call in try/catch and inform the user shutdown is unavailable in read-only mode","Only offer shutdown from a full, locally-running Studio"],"exampleFix":"// before\nawait shutDownStudio();\n// after\nif (!window.remotion_isReadOnlyStudio) {\n  await shutDownStudio();\n}","handlingStrategy":"type-guard","validationCode":"const canShutdown = !window.remotion_isReadOnlyStudio;","typeGuard":"const isWritableStudio = (): boolean => !window.remotion_isReadOnlyStudio;","tryCatchPattern":"try {\n  await shutDownStudio();\n} catch (e) {\n  if ((e as Error).message.includes('read-only')) {\n    // inform user shutdown is disabled in read-only Studio\n  } else { throw e; }\n}","preventionTips":["Check window.remotion_isReadOnlyStudio before rendering shutdown UI","Disable destructive Studio actions in read-only deployments","Add read-only awareness to Studio plugins/extensions"],"tags":["studio","permissions","read-only","api-misuse"],"backgroundTag":"permission-denied","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"}