remotion-dev/remotion · error

shutDownStudio() is not available in read-only Studio

Error message

shutDownStudio() is not available in read-only Studio

What it means

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.

Source

Thrown at packages/studio/src/api/shut-down-studio.ts:21

 * @see [Documentation](https://www.remotion.dev/docs/studio/shut-down-studio)
 */

import type {ShutdownStudioResponse} from '@remotion/studio-shared';
import {getRemotionEnvironment} from 'remotion';
import {callApi} from '../components/call-api';
import {getBrowserStudioOperations} from '../helpers/browser-studio-operations';

export const shutDownStudio = (): Promise<ShutdownStudioResponse> => {
	if (!getRemotionEnvironment().isStudio) {
		throw new Error('shutDownStudio() is only available in the Studio');
	}

	if (getBrowserStudioOperations() !== null) {
		throw new Error('shutDownStudio() is not supported in Browser Studio');
	}

	if (window.remotion_isReadOnlyStudio) {
		throw new Error('shutDownStudio() is not available in read-only Studio');
	}

	return callApi('/api/shutdown-studio', {});
};

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Check window.remotion_isReadOnlyStudio before calling shutDownStudio() and disable the UI
  2. Wrap the call in try/catch and inform the user shutdown is unavailable in read-only mode
  3. Only offer shutdown from a full, locally-running Studio

Example fix

// before
await shutDownStudio();
// after
if (!window.remotion_isReadOnlyStudio) {
  await shutDownStudio();
}
Defensive patterns

Strategy: type-guard

Validate before calling

const canShutdown = !window.remotion_isReadOnlyStudio;

Type guard

const isWritableStudio = (): boolean => !window.remotion_isReadOnlyStudio;

Try / catch

try {
  await shutDownStudio();
} catch (e) {
  if ((e as Error).message.includes('read-only')) {
    // inform user shutdown is disabled in read-only Studio
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling shutDownStudio() inside a read-only Studio (window.remotion_isReadOnlyStudio === true), such as a preview link or shared sandbox Studio.

Common situations: 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.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-09-09). Data as JSON: /api/errors/de49896b0588ebaa. Report an issue: GitHub.