remotion-dev/remotion · error · Error

getStaticFiles() has moved into the `@remotion/studio` packa

Error message

getStaticFiles() has moved into the `@remotion/studio` package. Update your imports.

What it means

Thrown by getStaticFiles() in @remotion/core when ENABLE_V5_BREAKING_CHANGES is on. In Remotion v5 the public-folder introspection API moved from @remotion/core to @remotion/studio, so the core re-export now refuses to run and directs callers to update their imports.

Source

Thrown at packages/core/src/get-static-files.ts:36

const warnPlayerOnce = () => {
	if (warnedPlayer) {
		return;
	}

	warnedPlayer = true;
	// eslint-disable-next-line no-console
	console.warn(
		'Called getStaticFiles() while using the Remotion Player. The API is only available while using the Remotion Studio. An empty array was returned.',
	);
};

/*
 * @description Gets an array containing all files in the `public/` folder. You can reference them by using `staticFile()`.
 * @see [Documentation](https://remotion.dev/docs/getstaticfiles)
 */
export const getStaticFiles = (): StaticFile[] => {
	if (ENABLE_V5_BREAKING_CHANGES) {
		throw new Error(
			'getStaticFiles() has moved into the `@remotion/studio` package. Update your imports.',
		);
	}

	if (typeof document === 'undefined') {
		warnServerOnce();
		return [];
	}

	if (window.remotion_isPlayer) {
		warnPlayerOnce();
		return [];
	}

	return window.remotion_staticFiles;
};

export type StaticFile = {

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Switch the import: import {getStaticFiles} from '@remotion/studio'; and remove it from '@remotion/core' / 'remotion'.
  2. If you only need it during studio development, gate the call behind a studio-only code path.
  3. Run the v5 migration guide's codemod or search-and-replace for all getStaticFiles usages.

Example fix

// before
import {getStaticFiles} from 'remotion';

// after
import {getStaticFiles} from '@remotion/studio';
Defensive patterns

Strategy: validation

Validate before calling

// At build time, ensure getStaticFiles is imported from @remotion/studio.
// Runtime guard is not applicable — fix imports instead.
// Example correct import:
import {getStaticFiles} from '@remotion/studio';

Prevention

When it happens

Trigger: Importing getStaticFiles from '@remotion/core' (or 'remotion') while running with v5 breaking changes enabled.

Common situations: Upgrading a project to Remotion v5; CI that flips the v5 flag; code that predates the package split still importing from 'remotion'.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/b000e925724f627f. Report an issue: GitHub.