remotion-dev/remotion · error · TypeError

bundle() was called without the `entryPoint` option

Error message

bundle() was called without the `entryPoint` option

What it means

When bundle() is called with a single object argument, that object must have a string `entryPoint`. If entryPoint is missing or not a string (undefined, number, object), convertBundleArgumentsIntoOptions throws a TypeError. This catches dynamically-built options where the entry point was never set.

Source

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

	}

	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 = '';
	for (let i = 0; i < recursionLimit; i++) {
		possibleFile = path.join(currentDir, file);
		const exists = fs.existsSync(possibleFile);
		if (exists) {
			return path.dirname(possibleFile);
		}

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Ensure the options object always sets entryPoint to a string path.
  2. Type the builder so entryPoint is required (BundleOptions already requires it).
  3. Default entryPoint to a known-good value before calling bundle().
  4. Double-check the camelCase key name (entryPoint, not entry_point or entrypoint).

Example fix

// before
bundle({...userConfig}); // userConfig has no entryPoint

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

Strategy: type-guard

Validate before calling

// Before calling bundle()
const assertBundleOptions = (opts: unknown) => {
  if (typeof opts !== 'object' || opts === null || typeof (opts as any).entryPoint !== 'string') {
    throw new TypeError('bundle() options must include a string entryPoint');
  }
};

Type guard

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

Prevention

When it happens

Trigger: Calling bundle({}) , bundle({onProgress: fn}), bundle({...rest}) where rest lacks entryPoint, or bundle({entryPoint: someUndefinedVar}).

Common situations: Building options from partial config where entryPoint is conditionally set; typo (entrypoint vs entryPoint); variable shadowing producing undefined; spreading a config that doesn't include entryPoint.

Related errors


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