{"record":{"id":"691a3740811b9858","repo":"remotion-dev/remotion","slug":"bundle-no-longer-supports-the-legacy-positional","errorCode":null,"errorMessage":"bundle() no longer supports the legacy positional arguments. Pass an options object instead: bundle({entryPoint, onProgress, ...options}).","messagePattern":"bundle\\(\\) no longer supports the legacy positional arguments\\. Pass an options object instead: bundle\\((.+?)\\)\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/bundler/src/bundle.ts","lineNumber":215,"sourceCode":"export 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') {\n\t\tthrow new TypeError('bundle() was called without the `entryPoint` option');\n\t}\n\n\treturn firstArg;\n};\n\nconst recursionLimit = 5;\n\nexport const findClosestFolderWithItem = (\n\tcurrentDir: string,\n\tfile: string,\n): string | null => {\n\tlet possibleFile = '';","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/bundler/src/bundle.ts#L197-L233","documentation":"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.","triggerScenarios":"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.","commonSituations":"Upgrading a project to Remotion v5; copy-pasted v4 example code; shared utilities still using the positional signature after the v5 flag flip.","solutions":["Convert to the options object: bundle({entryPoint: './src/index.ts', onProgress: fn, ...opts}).","Search the codebase for bundle( calls whose first arg is a string and migrate all of them.","Keep v4-style calls behind a version check, or fully commit to v5 in one pass.","Update internal helpers/wrappers to always build the options object."],"exampleFix":"// before (v4 style, fails in v5)\nbundle('./src/index.ts', onProgress, {publicDir: './public'});\n\n// after\nbundle({entryPoint: './src/index.ts', onProgress, publicDir: './public'});","handlingStrategy":"type-guard","validationCode":"// Detect v5 mode + positional call before forwarding to bundle()\nconst firstArg = args[0];\nif (enableV5BreakingChanges && typeof firstArg === 'string') {\n  throw new TypeError('Convert to bundle({entryPoint, ...}) for v5');\n}\n// build the options object instead:\nconst options = typeof firstArg === 'string'\n  ? {entryPoint: firstArg, onProgress: args[1], ...(args[2] ?? {})}\n  : firstArg;\nbundle(options);","typeGuard":"const isBundleOptionsObject = (arg: unknown): arg is {entryPoint: string} =>\n  typeof arg === 'object' && arg !== null && typeof (arg as {entryPoint?: unknown}).entryPoint === 'string';","tryCatchPattern":null,"preventionTips":["Migrate all bundle() call sites to the options-object form before enabling v5 breaking changes.","Search the codebase for bundle(' or bundle(entryPoint and update each.","Wrap bundle() in a single internal helper that always builds the options object.","Add a codemod or lint rule to flag positional bundle() calls."],"tags":["bundler","v5","breaking-change","migration","api-misuse"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}