Skip to content

Possible missing dependency on babel-runtime #307

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

Closed
christopherthielen opened this issue Feb 26, 2018 · 8 comments · Fixed by #310
Closed

Possible missing dependency on babel-runtime #307

christopherthielen opened this issue Feb 26, 2018 · 8 comments · Fixed by #310

Comments

@christopherthielen
Copy link

christopherthielen commented Feb 26, 2018

I'm submitting a bug report

Webpack version:
3.11.0

Webpack Karma version:
1.7.x

Karma version:
2.0.11

Please tell us about your environment:
OSX

Current behavior:

$ karma start
25 02 2018 19:56:08.367:ERROR [config]: Error in config file!
 { Error: Cannot find module 'babel-runtime/helpers/toConsumableArray'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/cthielen/projects/uirouter/sticky-states/node_modules/karma-webpack/lib/karma-webpack.js:3:27)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/cthielen/projects/uirouter/sticky-states/node_modules/karma-webpack/lib/index.js:7:18)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32) code: 'MODULE_NOT_FOUND' }
  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration.
git clone https://github.com/ui-router/sticky-states.git
cd sticky-states
git checkout karma-webpack
yarn
yarn add --dev [email protected]
yarn test

Adding babel-runtime as a dep fixes the issue. Guessing this was due to 6d28c5c. 2.0.9 was the last version of karma-webpack that worked without babel-runtime.

@dmk1111
Copy link

dmk1111 commented Feb 26, 2018

We had to lock version to 2.0.9 as this breaking change was not announced properly

@michael-ciniawsky
Copy link
Contributor

michael-ciniawsky commented Feb 26, 2018

Could someone please quick review (#310) ?

@michael-ciniawsky
Copy link
Contributor

Released in v2.0.12 🎉

@michael-ciniawsky michael-ciniawsky removed this from the 2.0.12 milestone Feb 26, 2018
@CaseyPeters
Copy link

CaseyPeters commented Feb 26, 2018

@michael-ciniawsky This is still failing for me in v2.0.12

peters@peters $ npm install
[email protected] node_modules/karma-webpack
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected]
peters@peters $ npm run ci:angular-unit-tests

> [email protected] ci:angular-unit-tests /Users/peters/IdeaProjects/campspot
> node --max_old_space_size=4096 $(npm bin)/karma start karma.ci.conf.js

26 02 2018 16:51:04.972:ERROR [plugin]: Error during loading "karma-webpack" plugin:
  Cannot find module 'babel-runtime/helpers/toConsumableArray'
26 02 2018 16:51:05.066:ERROR [preprocess]: Can not load "webpack", it is not registered!
  Perhaps you are missing some plugin?

START:
26 02 2018 16:51:05.229:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
26 02 2018 16:51:05.230:INFO [launcher]: Launching browser ChromeCustom with unlimited concurrency
26 02 2018 16:51:05.231:ERROR [karma]: Found 2 load errors

npm ERR! Darwin 17.4.0
npm ERR! argv "/Users/peters/.nvm/versions/node/v4.2.2/bin/node" "/Users/peters/.nvm/versions/node/v4.2.2/bin/npm" "run" "ci:angular-unit-tests"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] ci:angular-unit-tests: `node --max_old_space_size=4096 $(npm bin)/karma start karma.ci.conf.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] ci:angular-unit-tests script 'node --max_old_space_size=4096 $(npm bin)/karma start karma.ci.conf.js'.
npm ERR! This is most likely a problem with the campspot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node --max_old_space_size=4096 $(npm bin)/karma start karma.ci.conf.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls campspot
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/peters/IdeaProjects/campspot/npm-debug.log

@michael-ciniawsky
Copy link
Contributor

michael-ciniawsky commented Feb 26, 2018

😞 Could include some context ({Error} Logs, package.json etc), did you clean the npm/yarn cache and updated the lockfile etc ?

@CaseyPeters
Copy link

@michael-ciniawsky updated my previous comment with out console output. We are using it as a dev-dependency so it will not be included in our lockfile. I did clear the npm cache

@arturs-razmuss
Copy link

On project with
[email protected]
[email protected]
[email protected]
the following error is encountered.

ERROR [plugin]: Error during loading "C:\project\node_modules/karma-webpack" plugin:
  Cannot find module 'babel-runtime/helpers/toConsumableArray'
ERROR [preprocess]: Can not load "webpack", it is not registered!

This seems to be caused by the fact project doesn't use babel and babel-runtime is not provided as dependency by karma-webpack. Thus require call fails on \node_modules\karma-webpack\lib\karma-webpack.js:3

var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');

@benedikt-roth
Copy link

benedikt-roth commented Feb 28, 2018

Not sure why there is no notice, but just FYI: this was fixed in #312.
Note: could well be that it's gonna be reverted 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants