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

[commonjs] Undeclared value gets exported #532

Closed
bpierre opened this issue Aug 7, 2020 · 4 comments · Fixed by rollup/rollup#3738
Closed

[commonjs] Undeclared value gets exported #532

bpierre opened this issue Aug 7, 2020 · 4 comments · Fixed by rollup/rollup#3738

Comments

@bpierre
Copy link

bpierre commented Aug 7, 2020

How to reproduce:

git clone git@gist.github.com:981a9c9d79adc32f06c4bcf9fef3962c.git
cd 981a9c9d79adc32f06c4bcf9fef3962c
yarn && yarn rollup -c
cat dist/981a9c9d79adc32f06c4bcf9fef3962c/node_modules/@walletconnect/web3-provider/dist/cjs/index.js

Expected Behavior

The last line of the output shouldn’t contain index as i:

// …
export { cjs as __moduleExports };

Actual Behavior

An non-declared value, index, gets exported:

// …
export { cjs as __moduleExports, index as i };
@shellscape
Copy link
Collaborator

Thanks for opening an issue. Citing the issue template:

🚨 Issues WITHOUT a valid reproduction WILL BE CLOSED!

Please provide one by:

  1. Using the REPL.it plugin reproduction template at https://repl.it/@rollup/rollup-plugin-repro
  2. Provide a minimal repository link (Read https://git.io/fNzHA for instructions).
    Please use NPM for installing dependencies!
    These may take more time to triage than the other options.
  3. Using the Rollup REPL at https://rollupjs.org/repl/

⚠️ ZIP Files are unsafe and maintainers will NOT download them.

We cannot make this any clearer. Please add a valid reproduction from the list above and we'll be happy to triage further.

@shellscape
Copy link
Collaborator

Hey sorry, the script got ya. It doesn't recognize a gist as a repo. It's a little unorthodox, but no worries.

@shellscape shellscape reopened this Aug 7, 2020
@lukastaegert
Copy link
Member

It appears that this is a bug in Rollup core that is triggered by dynamically importing a file with synthetic named exports: https://repl.it/@lukastaegert/rollup-plugin-repro-1#dist/lib.js

@lukastaegert
Copy link
Member

Fix at rollup/rollup#3738

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.

3 participants