-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Rollup Version
4.5.0
Operating System (or Browser)
macOS Chrome
Node Version (if applicable)
v18
Link To Reproduction
Expected Behaviour
The RollupError shouldn't happen. It didn't happen in previous Rollup v3.
Actual Behaviour
RollupError: Identifier "maxArgs" has already been declared shows up.
This started when I upgrade my project to Vite 5 which uses Rollup v4.2.0 (older than current one). Running the build task produces this error:
The error happens in a library called moize. The line referred is in src/index.ts (not the dist). This library generates the dist output with Rollup ^3.21.5. I've tried cloning the moize repo on my local machine, upgrades the Rollup version to v4.2.0, run the build step and can confirm the same error happens. I've also tried v4.5.0 and same error happens.
I've funneled it down to this shortest reproducible code on REPL ❌:
const test = function maxArgs(maxArgs) {}
export default test;Here's 3 code examples that I can do to remove the error:

