Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'babel-runtime/helpers' #39

Closed
AprilArcus opened this issue Mar 11, 2015 · 14 comments
Closed

Cannot find module 'babel-runtime/helpers' #39

AprilArcus opened this issue Mar 11, 2015 · 14 comments

Comments

@AprilArcus
Copy link

I am getting this error when building with webpack/babel-loader:
Module not found: Error: Cannot resolve module 'babel-runtime/helpers'
last working version is babel-runtime 4.7.3. Maybe c.f. krakenjs/confit#39 ?

@sebmck
Copy link
Contributor

sebmck commented Mar 11, 2015

Reinstall babel-loader. rm -rf node_modules && npm install to get the latest version of babel.

@sebmck sebmck closed this as completed Mar 11, 2015
@AprilArcus
Copy link
Author

thank you!

@grawk
Copy link

grawk commented Mar 11, 2015

This didn't work for me. Should I see a patch version bump?

@sebmck
Copy link
Contributor

sebmck commented Mar 11, 2015

@grawk It's an internal babel "issue" unrelated to babel-loader. The internal structure of babel-runtime was changed which means that older babel versions output incorrect references to babel-runtime.

@grawk
Copy link

grawk commented Mar 11, 2015

OK. New to babel so pardon ignorance. I ran across this issue with https://github.com/krakenjs/confit which had "babel": "^4.6.6" as a devDependency and "babel-runtime": "^4.6.6" as a dependency. When I installed confit into a module where I use it, confit installed 4.7.8 of the babel-runtime, and I received the error mentioned in the issue title. I currently have a PR to confit pending which locks the babel versions to 4.7.3, which i tested and know to be working.

@sebmck
Copy link
Contributor

sebmck commented Mar 11, 2015

I'll need to make it much more obvious that the versions need to be locked
in the docs since they're essentially internal APIs.

On Wednesday, 11 March 2015, Matt Edelman notifications@github.com wrote:

OK. New to babel so pardon ignorance. I ran across this issue with
https://github.com/krakenjs/confit which had "babel": "^4.6.6" as a
devDependency and "babel-runtime": "^4.6.6" as a dependency. When I
installed confit into a module where I use it, confit installed 4.7.8 of
the babel-runtime, and I received the error mentioned in the issue title. I
currently have a PR to confit pending which locks the babel versions to
4.7.3, which i tested and know to be working.

Reply to this email directly or view it on GitHub
#39 (comment).

Sebastian McKenzie

@grawk
Copy link

grawk commented Mar 11, 2015

Maybe my mind was playing tricks but I appeared to have the same version of both modules (4.7.8) when I encountered the problem. Are you saying that I encountered it because the versions didn't match at some point?

@sebmck
Copy link
Contributor

sebmck commented Mar 11, 2015

Most likely. npm is really weird most of the time. babel-runtime is built
and published the same whenever I publish a new babel version so they're
guaranteed to be compatible.

On Wednesday, 11 March 2015, Matt Edelman notifications@github.com wrote:

Maybe my mind was playing tricks but I appeared to have the same version
of both modules (4.7.8) when I encountered the problem. Are you saying that
I encountered it because the versions were off at some point?

Reply to this email directly or view it on GitHub
#39 (comment).

Sebastian McKenzie

@kneekey23
Copy link

I am encountering this same issue and I have tried deleting node_modules and re-installing several times as well as npm clean cache --force and doing the same thing over. I always get this error in the browser when I run my .net core app: Error: Module build failed: Error: Cannot find module '@babel/helpers'

@victor-3wp
Copy link

Have you tried updating the @bable/runtime package

@jose920405
Copy link

Fix my problema installing "@babel/runtime": "7.0.0-beta.55",

@rifler
Copy link

rifler commented Aug 13, 2018

I publish lib with import _objectWithoutProperties from "@babel/runtime/helpers/builtin/es6/objectWithoutProperties";. Before publish, this lib runs @babel/... version beta.54.
Consumer, for example, uses rc.1, and this code breaks.
What is the right way to publish libs? move @babel from devDeps to deps?

@loganfsmyth
Copy link
Member

@rifler @babel/plugin-transform-runtime is a plugin for inserting imports that reference @babel/runtime. This means that @babel/runtime is required by the actual published code, and you should have @babel/runtime in dependencies, whereas you'd have @babel/plugin-transform-runtime in devDependencies.

Your code may have broken if you published your lib with the @babel/runtime dependency with ^ in the version number however, since that means you are stating that you depend on any future version of the @babel/runtime, and since we are still in a beta version, that can be a dangerous thing to do because things are still unstable. You want to be sure that the transform plugin, and @babel/runtime, have exactly the same version.

@rifler
Copy link

rifler commented Aug 15, 2018

In lib all @babel/* packages are in devDeps (beta.54), and consumer decides to use rc-1 version. After update all packages in lib to rc-1 (still all of them in devDeps) things start to work, because webpack now is able to find @babel/runtime/helpers/builtin/es6/objectWithoutProperties
Thank you for response, I'll move @babel/runtime to dependencies, because one day I may want to enable ssr

yukihirop added a commit to yukihirop/github-stocked-comments that referenced this issue Feb 5, 2019
Workaround:

 Cannot find module '@babel/runtime/helpers/interopRequireWildcard' from 'plugin.spec.js'

[reference]
babel/babel-loader#39
yukihirop added a commit to yukihirop/github-stocked-comments that referenced this issue Feb 5, 2019
Workaround:

 Cannot find module '@babel/runtime/helpers/interopRequireWildcard' from 'plugin.spec.js'

[reference]
babel/babel-loader#39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants