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

Modules with 'syntheticNamedExports' need a default export. #431

Closed
sirgalleto opened this issue Jun 2, 2020 · 3 comments · Fixed by #507
Closed

Modules with 'syntheticNamedExports' need a default export. #431

sirgalleto opened this issue Jun 2, 2020 · 3 comments · Fixed by #507

Comments

@sirgalleto
Copy link

sirgalleto commented Jun 2, 2020

Original here

  • Rollup Plugin Name: @rollup/plugin-commonjs
  • Rollup Plugin Version: 12.0.0
  • Rollup Version: 2.10.8
  • Operating System (or Browser): MacOS Catalina 10.15.4
  • Node Version: 12.16

How Do We Reproduce?

  1. Install a commonjs library with a single module.exports.
  2. Do a import default. Import from 'library'
  3. build with transformMixedEsModules: true.

https://repl.it/repls/StainedOrchidUserinterface

Expected Behavior

If I understand well, the transformMixedEsModules should first patch the default export and then pass it to syntheticNamedExports

Actual Behavior

transformMixedEsModules: true in commonjs() config:

Modules with 'syntheticNamedExports' need a default export. 
@shellscape
Copy link
Collaborator

We'll be happy to triage this once you've completed our bug issue template.

@sirgalleto
Copy link
Author

@shellscape updated, let me know if I'm missing something.

Thanks!

@lukastaegert
Copy link
Member

See ionic-team/rollup-plugin-node-polyfills#6 (comment) for explanation. The actual bug in this plugin will be fixed soon, but your code will still be broken unless you make sure rollup-plugin-node-polyfills is placed AFTER @rollup/plugin-commonjs in your plugins array.

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