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

Update of @rollup/plugin-node-resolve potentially breaks imports of core modules #886

Closed
PeterBurner opened this issue Sep 1, 2021 · 1 comment · Fixed by #887
Closed
Labels
has-fix A fix is available, but may not yet be released.

Comments

@PeterBurner
Copy link
Contributor

PeterBurner commented Sep 1, 2021

Description

When using the node module uuid an error is thrown during runtime:

crypto.getRandomValues() not supported.

After some research I found out that from @rollup/plugin-node-resolve version 11.0.0 onwards one needs to specify the option exportConditions: ['node'] in the rollup config for it to work.
Since microbundle does not expose the rollup config the only workaround for users is to downgrade @rollup/plugin-node-resolve@10.0.0 via yarn module resolutions.

Please add this option to the generated rollup config or expose it to the user.

Related Issues

@developit
Copy link
Owner

developit commented Sep 1, 2021

We should definitely be setting that condition when --target node is passed, yep.

developit added a commit that referenced this issue Sep 1, 2021
When bundling for a Node.js target, Microbundle should follow the "node" conditional package export key to match Node's own resolution. Fixes #886.
@developit developit added the has-fix A fix is available, but may not yet be released. label Sep 1, 2021
developit added a commit that referenced this issue Oct 6, 2021
* Resolve using "node" export condition for --target node

When bundling for a Node.js target, Microbundle should follow the "node" conditional package export key to match Node's own resolution. Fixes #886.

* lint

* Create fuzzy-trains-switch.md

* Update index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-fix A fix is available, but may not yet be released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants