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
- Pass an options object: bundle({entryPoint: './src/index.ts'}).
- If you support v4 callers, pass the positional entryPoint string as the first argument.
- Assert the args array is non-empty before forwarding it to bundle().
- 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
- Always pass an explicit options object to bundle(); never forward a possibly-empty array.
- Enable strict TypeScript checks so bundle() with no args is a compile error.
- Add a unit test asserting bundle() throws synchronously on empty input.
- When building args dynamically, default to a valid options object.
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
- bundle() was called without the `entryPoint` option
- bundle() no longer supports the legacy positional arguments.
- "${name}" must be greater than 0, but got ${JSON.stringify(v
- "${name}" must be greater than or equal to 0, but got ${JSON
- "colors" must be an array with at least 2 colors, but got ${
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/97461bf7121f6124.
Report an issue: GitHub.