remotion-dev/remotion · error · Error
restartStudio() is not available in read-only Studio
Error message
restartStudio() is not available in read-only Studio
What it means
`restartStudio()` requires a writable, server-backed Studio because it asks the Studio server to restart itself. When `window.remotion_isReadOnlyStudio` is true (Studio deployed in read-only mode, without write access to the project), the guard at packages/studio/src/api/restart-studio.ts:20 throws before any API call. The error signals an environment restriction, not a bug in the call.
Source
Thrown at packages/studio/src/api/restart-studio.ts:21
* @see [Documentation](https://www.remotion.dev/docs/studio/restart-studio)
*/
import type {RestartStudioResponse} from '@remotion/studio-shared';
import {getRemotionEnvironment} from 'remotion';
import {callApi} from '../components/call-api';
import {getBrowserStudioOperations} from '../helpers/browser-studio-operations';
export const restartStudio = (): Promise<RestartStudioResponse> => {
if (!getRemotionEnvironment().isStudio) {
throw new Error('restartStudio() is only available in the Studio');
}
if (getBrowserStudioOperations() !== null) {
throw new Error('restartStudio() is not supported in Browser Studio');
}
if (window.remotion_isReadOnlyStudio) {
throw new Error('restartStudio() is not available in read-only Studio');
}
return callApi('/api/restart-studio', {});
};
View on GitHub (pinned to 10db9de073)
Solutions
- Run the full Studio from your project directory with `npx remotion studio`, which is not read-only, and call `restartStudio()` there.
- Guard the call site with `window.remotion_isReadOnlyStudio` before invoking `restartStudio()`.
- In read-only deployments, restart by restarting the hosting process/page instead of this API.
Example fix
// before
import {restartStudio} from '@remotion/studio';
await restartStudio(); // throws: read-only Studio
// after
import {restartStudio} from '@remotion/studio';
if (!window.remotion_isReadOnlyStudio) {
await restartStudio();
} Defensive patterns
Strategy: type-guard
Validate before calling
if (!window.remotion_isReadOnlyStudio) {
const {restartStudio} = await import('@remotion/studio');
await restartStudio();
} Type guard
const isWritableStudio = (): boolean => typeof window !== 'undefined' && !window.remotion_isReadOnlyStudio;
Try / catch
try {
await restartStudio();
} catch (err) {
if (err instanceof Error && err.message.includes('read-only Studio')) {
// Read-only deployment: nothing to restart here
} else {
throw err;
}
} Prevention
- Hide write-mode actions (restart, save, install) whenever `window.remotion_isReadOnlyStudio` is set.
- Test Studio extensions in both writable (`npx remotion studio`) and read-only deployments before shipping.
When it happens
Trigger: Invoking `restartStudio()` from `@remotion/studio` while `window.remotion_isReadOnlyStudio` is set — i.e. a read-only Studio deployment (static/embedded Studio without file or server access). The other guards pass (it IS Studio and not Browser Studio), then this third guard fires.
Common situations: Studio opened from a read-only mount or embedded viewer (docs/demo deployments, sandboxed previews); CI/static exports of Studio; attempting write-type operations (restart, save, install) in environments intentionally locked to read-only.
Related errors
- restartStudio() is not supported in Browser Studio
- restartStudio() is only available in the Studio
- installPackages() is not available in Read-Only Studio
- shutDownStudio() is only available in the Studio
- shutDownStudio() is not supported in Browser Studio
AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22).
Data as JSON: /api/errors/b4a069a8073eebca.
Report an issue: GitHub.