{"record":{"id":"97461bf7121f6124","repo":"remotion-dev/remotion","slug":"bundle-was-called-without-arguments","errorCode":null,"errorMessage":"bundle() was called without arguments","messagePattern":"bundle\\(\\) was called without arguments","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/bundler/src/bundle.ts","lineNumber":202,"sourceCode":"type V4BundleArguments =\n\t| [options: BundleOptions]\n\t| [\n\t\t\tentryPoint: string,\n\t\t\tonProgress?: (progress: number) => void,\n\t\t\toptions?: V4LegacyBundleOptions,\n\t  ];\n\ntype BundleArguments =\n\ttypeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true\n\t\t? [options: BundleOptions]\n\t\t: V4BundleArguments;\n\nexport const convertBundleArgumentsIntoOptions = (\n\targs: V4BundleArguments,\n\tenableV5BreakingChanges: boolean,\n): BundleOptions => {\n\tif ((args.length as number) === 0) {\n\t\tthrow new TypeError('bundle() was called without arguments');\n\t}\n\n\tconst firstArg = args[0];\n\tif (typeof firstArg === 'string') {\n\t\tif (!enableV5BreakingChanges) {\n\t\t\treturn {\n\t\t\t\tentryPoint: firstArg,\n\t\t\t\tonProgress: args[1],\n\t\t\t\t...(args[2] ?? {}),\n\t\t\t};\n\t\t}\n\n\t\tthrow new TypeError(\n\t\t\t'bundle() no longer supports the legacy positional arguments. Pass an options object instead: bundle({entryPoint, onProgress, ...options}).',\n\t\t);\n\t}\n\n\tif (typeof firstArg.entryPoint !== 'string') {","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/bundler/src/bundle.ts#L184-L220","documentation":"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.","triggerScenarios":"Calling bundle() with zero arguments, e.g. by spreading an empty array (bundle(...([]))), destructuring that yields nothing, or a refactor that drops the argument.","commonSituations":"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.","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."],"exampleFix":"// before\nbundle();\n\n// after\nbundle({entryPoint: './src/index.ts'});","handlingStrategy":"type-guard","validationCode":"const ensureBundleArgs = (args: unknown[]) => {\n  if (args.length === 0) {\n    throw new TypeError('bundle() requires at least one argument');\n  }\n};\n// then forward: bundle(...args)","typeGuard":"const hasBundleArguments = (args: unknown[]): args is [unknown, ...unknown[]] =>\n  args.length > 0;","tryCatchPattern":null,"preventionTips":["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."],"tags":["bundler","api-misuse","typescript","arguments"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}