create-react-app: "Cannot resolve module babel-runtime/regenerator"
I get this message when I use generators because babel-runtime
is not a runtime dependency of the generated project. I didn’t notice this when I merged #238 because I tested only the local flow (npm run create-react-app
).
I see three possible solutions:
- Document this as a known gotcha in the howto. (People using generators would probably find it quick enough.)
- Put
babel-runtime
into everyone’sdependencies
on project creation regardless of whether they actually use generators. (Not very good, we have no control over the version, and this exposes Babel to users which we’d rather avoid.) - Add an option to
babel-plugin-transform-runtime
that would let us setruntimeModuleName
to a resolved path. (I would prefer this.)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 18 (9 by maintainers)
Commits related to this issue
- Add a temporary fix for generators This enables us to ship them now, and find a way to resolve runtime path without webpack later. See https://github.com/facebookincubator/create-react-app/issues/255 — committed to facebook/create-react-app by gaearon 8 years ago
- Add a temporary fix for generators (#262) This enables us to ship them now, and find a way to resolve runtime path without webpack later. See https://github.com/facebookincubator/create-react-app/is... — committed to facebook/create-react-app by gaearon 8 years ago
- Resolve babel-runtime relative to the config This makes generators work with Jest. Fixes #255. Replaces #262. — committed to facebook/create-react-app by gaearon 8 years ago
- Resolve babel-runtime relative to the config (#535) This makes generators work with Jest. Fixes #255. Replaces #262. — committed to facebook/create-react-app by gaearon 8 years ago
- Resolve babel-runtime relative to the config (#535) This makes generators work with Jest. Fixes #255. Replaces #262. — committed to stayradiated/create-react-app by gaearon 8 years ago
- Resolve babel-runtime relative to the config (#535) This makes generators work with Jest. Fixes #255. Replaces #262. — committed to feiqitian/create-react-app by gaearon 8 years ago
Sorry for bumping old issue here…
Recently, out of nowhere, I started having issues with missing
babel-runtime
:Adding
babel-runtime
to my dependencies fixes this issue but I’m not sure if this is the right way to go about it?https://github.com/babel/babel/pull/3612 is released in v6.15.0 of babel-plugin-transform-runtime
npm view babel-plugin-transform-runtime dist-tags