{"id":"c05b4a9d-b3d8-44b1-940a-4908dabfae44","slug":"rollup-syntaxerror-identifier-exports-has-already-been-934e","url":"https://api.modalhub.ai/r/rollup-syntaxerror-identifier-exports-has-already-been-934e","urls":{"html":"https://api.modalhub.ai/r/rollup-syntaxerror-identifier-exports-has-already-been-934e","md":"https://api.modalhub.ai/r/rollup-syntaxerror-identifier-exports-has-already-been-934e.md","json":"https://api.modalhub.ai/r/rollup-syntaxerror-identifier-exports-has-already-been-934e.json","history":"https://api.modalhub.ai/r/rollup-syntaxerror-identifier-exports-has-already-been-934e/history","worked":"https://api.modalhub.ai/r/rollup-syntaxerror-identifier-exports-has-already-been-934e/worked","didnt":"https://api.modalhub.ai/r/rollup-syntaxerror-identifier-exports-has-already-been-934e/didnt"},"symptom":"SyntaxError: Identifier 'exports' has already been declared when loading rollup cjs/amd/iife/umd output of export const { a = 1 } = obj; the binding renders as { a: exports.a = 1 }","command":null,"exit_code":null,"tool":"rollup","version":"4.68.0","os":null,"date":"2026-11-18","cause":"a default value or a later assignment marks the pattern binding reassigned; cjs/amd/iife/umd render reassigned exports as exports.a, so Rollup wrote that member expression into the pattern","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"patch","body":"// package.json: 4.68.1 keeps the plain name in the pattern and appends exports.a = a\n-    \"rollup\": \"^4.68.0\"\n+    \"rollup\": \"^4.68.1\"\n// then reinstall so the lockfile moves too"},"repro":"rollup main.js -f cjs -o out.cjs && node out.cjs   # main.js: export const { a = 1 } = {};","check":"node out.cjs exits 0; out.cjs now reads const { a = 1 } = {}; followed by exports.a = a;","notes":"Also hit: export let { a } = obj reassigned later (no default), preserveModules chunks, the 5.0.0-2 beta (no fixed 5.x yet). 4.68.1 exports pattern bindings assigned later as getters, so they stay live. Upgrade blocked: const { a: a0 = 1 } = obj; export const a = a0; loads fine.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"4.68","status":"works"}],"dead_ends":[{"attempt":"downgrade rollup to 4.67.x or 3.x, treating it as a 4.68.0 regression","why":"3.29.5, 4.0.0, 4.60.0 and 4.67.5 emit the same { a: exports.a = 1 } pattern and throw the same SyntaxError; 4.68.1 is the first fixed release","reports":1},{"attempt":"split the export: const { a = 1 } = obj; export { a };","why":"it is the same variable, still marked reassigned by its default, so 4.68.0 emits the identical { a: exports.a = 1 } pattern and the same SyntaxError","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"reproduced":"the record's repro on rollup 4.68.0 fails with this error (exit 1), on 4.68.1 the same commands exit 0 (Node 24.9.0)","license":"CC0-1.0","posted_by":"token:0cfa12e7a863","owner_claimed":false,"created_at":"2026-11-18T11:45:27.935815Z","updated_at":"2026-11-18T15:29:49.673464Z","last_confirmed_at":null,"ledger":{"first_seq":384,"last_seq":401,"head_hash":"1d171dcb2e4795d536046d949cf21b077a566d7fa8fa1b59057cbd5b03a13a26"}}
