react-spring: Breaks build using latest Babel
Toplevel Unhandled rejection { Error: Cannot find module '@babel/runtime/helpers/builtin/extends'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/node_modules/react-spring/dist/web.cjs.js:7:32)
...
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 18 (12 by maintainers)
I had a similar issue after upgrading my dependencies today. 2 out 3 installed packages that depend on
@babel/runtimeare using different versions of it:The one from
react-scriptswins -I’m using react-scripts@next.react-scriptsis a direct dependency of the project andreact-springis included through another package. I wonder if it has anything to do with that.It might also be a module resolution issue because
react-springhas the right babel package installed on itsnode_modules.Installing
@babel/runtimein my own package and pinning it to7.0.0-rc.3doesn’t fix it either. After doing this,7.0.0-rc.3is installed in the mainnode_modulesand7.0.0-beta.42is insidereact-scripts/node_modules. However, the resolution still fails. If I were to require@babel/runtime/helpers/builtin/extends.jsin a node repl, it finds it alright. So I’m thinking, might this be an issue with how webpack is resolving the modules?The only workaround I could find so far is to remove the older version of
@babel/runtimeinsidereact-scripts/node_modules. Hopefully libraries upgrading to the soon to be released (this week it seems?) babel 7 will sort these inconsistencies out.This ended up being more of a brain dump, it may help others that are stuck with the same issue!