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’s dependencies 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 set runtimeModuleName 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

Most upvoted comments

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