Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with rollup 4.6.0, building with jspreadsheet #5274

Closed
olivierchatry opened this issue Nov 28, 2023 · 3 comments · Fixed by #5276
Closed

Issue with rollup 4.6.0, building with jspreadsheet #5274

olivierchatry opened this issue Nov 28, 2023 · 3 comments · Fixed by #5276

Comments

@olivierchatry
Copy link

Rollup Version

4.5.1

Operating System (or Browser)

Fedora 39

Node Version (if applicable)

20

Link To Reproduction

https://stackblitz.com/edit/vitejs-vite-kuhfs9?file=index.html,package.json&terminal=dev

Expected Behaviour

Software should build. I'm sorry I used a vite repl, but it's the only way I found to show the behavior. I think 4.6.0 does not work as well as when I force the dependency, I get the same results.

Actual Behaviour

11.19 [commonjs--resolver] Identifier "val" has already been declared
11.19 file: /build/app/node_modules/jspreadsheet-ce/dist/index.js:3499:24
11.19 3497: var i = parseInt(time[1]);
11.19 3498: obj.date = [y, m, d, h, i, 0];
11.19 3499: var val = obj.setLabel(newValue, obj.options);
11.19 ^
11.19 3500:
11.19 3501: // Current selection day
11.19 error during build:
11.19 RollupError: Identifier "val" has already been declared
11.19 at error (file:///build/app/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
11.19 at Module.error (file:///build/app/node_modules/rollup/dist/es/shared/node-entry.js:12737:16)
11.19 at BlockScope.addDeclaration (file:///build/app/node_modules/rollup/dist/es/shared/node-entry.js:7520:32)
11.19 at TrackingScope.addDeclaration (file:///build/app/node_modules/rollup/dist/es/shared/node-entry.js:7522:50)
11.19 at TrackingScope.addDeclaration (file:///build/app/node_modules/rollup/dist/es/shared/node-entry.js:9767:22)
11.19 at BlockScope.addDeclaration (file:///build/app/node_modules/rollup/dist/es/shared/node-entry.js:7522:50)
11.19 at Identifier.declare (file:///build/app/node_modules/rollup/dist/es/shared/node-entry.js:7188:39)
11.19 at VariableDeclarator.declareDeclarator (file:///build/app/node_modules/rollup/dist/es/shared/node-entry.js:10178:17)
11.19 at VariableDeclaration.initialise (file:///build/app/node_modules/rollup/dist/es/shared/node-entry.js:11843:24)
11.19 at new NodeBase (file:///build/app/node_modules/rollup/dist/es/shared/node-entry.js:4607:14)

@sapphi-red
Copy link
Contributor

minimal reproduction: 1, 2

Interestingly, if I remove the val in if or else or the parameter, the error disappears.

BTW the parse error itself was happening in ./node_modules/jsuites/dist/jsuites.js instead of ./node_modules/jspreadsheet-ce/dist/index.js.

@lukastaegert
Copy link
Member

Thanks, this was a huge help. Fix at #5276.

Copy link

This issue has been resolved via #5276 as part of rollup@4.6.1. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants