cannot load 'webpack'
See original GitHub issueErrors:
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:
- Created 8 years ago
- Comments:24
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.
@pojka @jingzhou123 I’ve just checked you repo and everything is working fine for me, I ran
Could you check that you are using
karma-cliand notkarmainstalled globally, and make sure the global version which you call withkarmais actually up to date.