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

Fix corejs3 failure on fresh checkout #86

Closed
wants to merge 3 commits into from

Conversation

matthargett
Copy link

On a fresh checkout, I was getting an error with the build and test targets:

$ rollup --config

src/ReactShallowRenderer.js → build/cjs/react-shallow-renderer.js...
[!] (plugin babel) Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'
Require stack:
- /Users/mhargett/src/react-shallow-renderer/node_modules/@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js
- /Users/mhargett/src/react-shallow-renderer/node_modules/@babel/preset-env/lib/index.js
- /Users/mhargett/src/react-shallow-renderer/node_modules/@babel/core/lib/config/files/plugins.js
- /Users/mhargett/src/react-shallow-renderer/node_modules/@babel/core/lib/config/files/index.js
- /Users/mhargett/src/react-shallow-renderer/node_modules/@babel/core/lib/index.js
- /Users/mhargett/src/react-shallow-renderer/node_modules/rollup-plugin-babel/dist/rollup-plugin-babel.cjs.js
- /Users/mhargett/src/react-shallow-renderer/rollup.config.js
- /Users/mhargett/src/react-shallow-renderer/node_modules/rollup/dist/bin/rollup

this was with nodejs 12.18.3 on MacOS 10.15. The bare minimum to fix the error is in the first commit, but I figured I would bump the rest of the packages to the same version so long as the build and tests passed.

Note that I couldn't update @babel/plugin-transform-classes package : any later version causes an error.

…r: Cannot find module '@babel/compat-data/corejs3-shipped-proposals''
…classes gives an error when updated to 7.12.x.
@NMinhNguyen
Copy link
Collaborator

Thanks for raising this. I just did a fresh checkout of the repo via git clone https://github.com/NMinhNguyen/react-shallow-renderer, ran yarn and yarn build and the build succeeded. But that was using Node.js 10, when I switched to 12, I was able to observe the same failure.

However, given that the published version of react-shallow-renderer works as is, I'd like to be very careful to avoid any possible regressions (see this comment from the React team facebook/react#18144 (review)) and hold off on merging this. There are a bunch of Dependabot updates that do the same but it's not a big priority and would require manually inspecting the bundle diff to ensure there's no regressions.

@NMinhNguyen
Copy link
Collaborator

Superseded by #93.

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

Successfully merging this pull request may close these issues.

2 participants