question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot load 'webpack'

See original GitHub issue
Errors:
Can not load "webpack"!
  TypeError: undefined is not a function
    at Plugin.notifyKarmaAboutChanges (/Users/jz/jsfiddles/template/node_modules/karma-webpack/index.js:108:15)
    at Plugin.<anonymous> (/Users/jz/jsfiddles/template/node_modules/karma-webpack/index.js:72:9)
    at Tapable.applyPlugins (/Users/jz/jsfiddles/template/node_modules/webpack/node_modules/tapable/lib/Tapable.js:26:37)
    at Watching._done (/Users/jz/jsfiddles/template/node_modules/webpack/lib/Compiler.js:78:17)
    at Watching.<anonymous> (/Users/jz/jsfiddles/template/node_modules/webpack/lib/Compiler.js:61:18)
    at Tapable.emitRecords (/Users/jz/jsfiddles/template/node_modules/webpack/lib/Compiler.js:281:37)
    at Watching.<anonymous> (/Users/jz/jsfiddles/template/node_modules/webpack/lib/Compiler.js:58:19)
    at /Users/jz/jsfiddles/template/node_modules/webpack/lib/Compiler.js:274:11
    at Tapable.applyPluginsAsync (/Users/jz/jsfiddles/template/node_modules/webpack/node_modules/tapable/lib/Tapable.js:60:69)
    at Tapable.afterEmit (/Users/jz/jsfiddles/template/node_modules/webpack/lib/Compiler.js:271:8)

here is my package.json file

{
  "name": "components",
  "version": "0.0.1",
  "description": "components",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {




  },
  "devDependencies": {
    "babel-core": "^5.8.9",
    "babel-loader": "^5.3.2",
    "css-loader": "^0.15.6",
    "jasmine-core": "^2.3.4",
    "karma": "^0.12.37",
    "karma-chrome-launcher": "^0.2.0",
    "karma-jasmine": "^0.3.6",
    "karma-sourcemap-loader": "^0.3.5",
    "karma-webpack": "^1.6.0",
    "less": "^2.5.1",
    "less-loader": "^2.2.0",
    "lodash": "^3.10.0",
    "style-loader": "^0.12.3",
    "webpack": "^1.10.5"
  }
}

I change karma version to ~0.12.37 and karma-webpack to ~1.6.0,it works; But when karma-webpack is 1.7.0, it throw errors when I run karma start karma.config.js

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:24

github_iconTop GitHub Comments

9reactions
joeheymingcommented, Jun 29, 2016

wow, this whole time I wasn’t using node_modules/.bin/karma and was instead using the global karma.

Just wanted to say this in case anyone else had the same issue.

8reactions
dignifiedquirecommented, Sep 8, 2015

@pojka @jingzhou123 I’ve just checked you repo and everything is working fine for me, I ran

$ npm install
$ node_modules/.bin/karma start karma.conf.js

Could you check that you are using karma-cli and not karma installed globally, and make sure the global version which you call with karma is actually up to date.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Karma can't load webpack - Stack Overflow
WARN [preprocess]: Can not load "webpack"! TypeError: Object [object Object] has no method 'refreshFiles' at Plugin.
Read more >
[4.0.2] ERROR [preprocess]: Can not load "webpack"! #421
I got this error after update from 4.0.0-rc.6 to 4.0.2. 18 06 2019 16:32:50.308:ERROR [preprocess]: Can not load "webpack"!
Read more >
Module Federation - webpack
Remote modules are modules that are not part of the current build but are loaded at runtime from a remote container. Loading remote...
Read more >
Why does webpack doesn't load my modules well - Laracasts
Hey, good day. Anyone of you does know why does my page doesn't load to my latest run of webpack and it only...
Read more >
IDE "failed to load" webpack config that exports function taking ...
IDE "failed to load" webpack config that exports function taking env and returning the config object · 1. Ensure that the Javascript language...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found