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/runtime
are using different versions of it:The one from
react-scripts
wins -I’m using react-scripts@next.react-scripts
is a direct dependency of the project andreact-spring
is included through another package. I wonder if it has anything to do with that.It might also be a module resolution issue because
react-spring
has the right babel package installed on itsnode_modules
.Installing
@babel/runtime
in my own package and pinning it to7.0.0-rc.3
doesn’t fix it either. After doing this,7.0.0-rc.3
is installed in the mainnode_modules
and7.0.0-beta.42
is insidereact-scripts/node_modules
. However, the resolution still fails. If I were to require@babel/runtime/helpers/builtin/extends.js
in 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/runtime
insidereact-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!