Please choose a version of "babel-plugin-named-asset-import" in custom react-scripts package
See original GitHub issueI’m trying to maintain a separate fork of react-scripts@next
with some webpack configuration changes that I want to use without ejecting. I’m noticing that if I branch from the commit
react-scripts@2.0.0-next.a671462c
then change the package JSON information and publish to my specific npm account, when I try to install my own version I get prompted with:
Please choose a version of “babel-plugin-named-asset-import” from this list: 1.0.0-next.b2fd8db8 1.0.0-next.a671462c 1.0.0-next.66cc7a90
I picked a671462c
since it’s the same hash as the scripts version is branched out of, but I end up with Error: Cannot find module 'react-dev-utils/browsersHelper'
.
I know this may not be supported by you guys directly, but I was wondering if anyone could give me some insight on how to fix this.
Thanks in advance!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top GitHub Comments
@jcmandersson, I didn’t solve it.
The issue is that the package dependencies are being automatically updated when you deploy via lerna to match one another - if you look at the dependency list after installing CRA’s next versus a fork of next, they are completely different. So essentially what you would need to do is update every package (not just react-scripts) to your own name in the various
package.json
files, update the requires to pull in your version of said package, then do a publish to your own npm.I felt like that was too many hurdles to deal with and would make merging any upstream changes challenging, so I decided to go with a different route.
Thanks @sowhatdoido
I took a completely different route with next.js and created my own boilerplate repo. Not ideal since it will be hard to keep the boilerplate code (like webpack config) updated for old projects. But good enough for me right now.