Live bindings for multiple exports do not update correctly on cjs.
Open
Nobody has claimed this yet.
t¹ 🐞 bug
t⁸ ⋅ triage
- Dominant language
- JavaScript
- Stars
- 26.3k
- Forks
- 1.8k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 20
Description
Rollup Version
4.0.0
Operating System (or Browser)
Browser
Node Version (if applicable)
No response
Link To Reproduction
Expected Behaviour
// input.js
let a = 3;
export {a, a as b}
export function set() {
a = 4;
}
// output.cjs
'use strict';
exports.a = exports.b = 3;
function set() {
exports.a = exports.b = 4;
}
exports.set = set;
Actual Behaviour
// input.js
let a = 3;
export {a, a as b}
export function set() {
a = 4;
}
// output.cjs
'use strict';
exports.b = 3;
function set() {
exports.b = 4;
}
exports.a = exports.b;
exports.set = set;
exports.a does not updated on a reassigned.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Rollup REPL reproduction and compare the shown input.js and output.cjs for the CommonJS output. Trace how the two exports of the same binding are generated, then verify that reassigning a updates both exports and that the output matches the expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100