remotion-dev/remotion · error · TypeError

bundle() no longer supports the legacy positional arguments.

Error message

bundle() no longer supports the legacy positional arguments. Pass an options object instead: bundle({entryPoint, onProgress, ...options}).

What it means

When ENABLE_V5_BREAKING_CHANGES is on, Remotion v5 removes the legacy positional bundle(entryPoint, onProgress, options) form. If the first argument is a string in v5 mode, convertBundleArgumentsIntoOptions throws a TypeError directing you to the options-object form. This is a deliberate migration gate.

Source

Thrown at packages/bundler/src/bundle.ts:215

export const convertBundleArgumentsIntoOptions = (
	args: V4BundleArguments,
	enableV5BreakingChanges: boolean,
): BundleOptions => {
	if ((args.length as number) === 0) {
		throw new TypeError('bundle() was called without arguments');
	}

	const firstArg = args[0];
	if (typeof firstArg === 'string') {
		if (!enableV5BreakingChanges) {
			return {
				entryPoint: firstArg,
				onProgress: args[1],
				...(args[2] ?? {}),
			};
		}

		throw new TypeError(
			'bundle() no longer supports the legacy positional arguments. Pass an options object instead: bundle({entryPoint, onProgress, ...options}).',
		);
	}

	if (typeof firstArg.entryPoint !== 'string') {
		throw new TypeError('bundle() was called without the `entryPoint` option');
	}

	return firstArg;
};

const recursionLimit = 5;

export const findClosestFolderWithItem = (
	currentDir: string,
	file: string,
): string | null => {
	let possibleFile = '';

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Convert to the options object: bundle({entryPoint: './src/index.ts', onProgress: fn, ...opts}).
  2. Search the codebase for bundle( calls whose first arg is a string and migrate all of them.
  3. Keep v4-style calls behind a version check, or fully commit to v5 in one pass.
  4. Update internal helpers/wrappers to always build the options object.

Example fix

// before (v4 style, fails in v5)
bundle('./src/index.ts', onProgress, {publicDir: './public'});

// after
bundle({entryPoint: './src/index.ts', onProgress, publicDir: './public'});
Defensive patterns

Strategy: type-guard

Validate before calling

// Detect v5 mode + positional call before forwarding to bundle()
const firstArg = args[0];
if (enableV5BreakingChanges && typeof firstArg === 'string') {
  throw new TypeError('Convert to bundle({entryPoint, ...}) for v5');
}
// build the options object instead:
const options = typeof firstArg === 'string'
  ? {entryPoint: firstArg, onProgress: args[1], ...(args[2] ?? {})}
  : firstArg;
bundle(options);

Type guard

const isBundleOptionsObject = (arg: unknown): arg is {entryPoint: string} =>
  typeof arg === 'object' && arg !== null && typeof (arg as {entryPoint?: unknown}).entryPoint === 'string';

Prevention

When it happens

Trigger: Running with v5 breaking changes enabled and calling bundle('./src/index.ts') or bundle(entryPoint, onProgress) positionally. Any v4-style positional call hits this in v5.

Common situations: Upgrading a project to Remotion v5; copy-pasted v4 example code; shared utilities still using the positional signature after the v5 flag flip.

Related errors


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