remotion-dev/remotion · error · TypeError

bundle() was called without arguments

Error message

bundle() was called without arguments

What it means

Remotion's bundle() requires at least one argument. convertBundleArgumentsIntoOptions throws a TypeError when args.length === 0, because bundling needs an entry point. This is a pure programming error, not an environment issue.

Source

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

type V4BundleArguments =
	| [options: BundleOptions]
	| [
			entryPoint: string,
			onProgress?: (progress: number) => void,
			options?: V4LegacyBundleOptions,
	  ];

type BundleArguments =
	typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true
		? [options: BundleOptions]
		: V4BundleArguments;

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') {

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Pass an options object: bundle({entryPoint: './src/index.ts'}).
  2. If you support v4 callers, pass the positional entryPoint string as the first argument.
  3. Assert the args array is non-empty before forwarding it to bundle().
  4. Add a TypeScript signature check / unit test that bundle() with no args is a compile error.

Example fix

// before
bundle();

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

Strategy: type-guard

Validate before calling

const ensureBundleArgs = (args: unknown[]) => {
  if (args.length === 0) {
    throw new TypeError('bundle() requires at least one argument');
  }
};
// then forward: bundle(...args)

Type guard

const hasBundleArguments = (args: unknown[]): args is [unknown, ...unknown[]] =>
  args.length > 0;

Prevention

When it happens

Trigger: Calling bundle() with zero arguments, e.g. by spreading an empty array (bundle(...([]))), destructuring that yields nothing, or a refactor that drops the argument.

Common situations: Refactoring removes the argument accidentally; dynamically building args from a possibly-empty config; copy-paste from docs that omitted the argument; calling the wrong overload.

Related errors


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