Comments (24)
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.
from karma-webpack.
@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.
from karma-webpack.
@joeheyming Good call out. Didn't even think of that. Completely fixed my issues.
from karma-webpack.
Duplicate of #68 and see #63 for more details. You need to upgrade karma to 0.13
to fix the issue
from karma-webpack.
I'm seeing this issue with fixed versions of karma 0.13.4 and karma-webpack 1.7.0
Can not load "webpack"!
TypeError: undefined is not a function
at Plugin.notifyKarmaAboutChanges (/Projects/utilass/node_modules/karma-webpack/index.js:108:15)
from karma-webpack.
@pojka could you show me the output of npm ls
please
from karma-webpack.
@dignifiedquire sure - https://gist.github.com/pojka/49307fbb77d1c0ee18ed
Please let me know if I'm being dumb :)
from karma-webpack.
@pojka looks like there is another bug in there :( thanks for the report
from karma-webpack.
I have the same problem, how can I temporarily solve this? Or I need to wait for fix? Thanks.
EDIT: Or can I help you with my logs?
from karma-webpack.
@kmaraz using the following combination works for me for the moment:
"karma": "0.12.37", "karma-webpack": "1.6.0",
from karma-webpack.
@pojka Thanks!
@dignifiedquire If you need my logs, just tell me, please.
from karma-webpack.
Hello, isn't there a way NOT to use old versions? 👍
from karma-webpack.
+1
we are experiencing the same issue
from karma-webpack.
Does someone have repo which fails with this error, using [email protected]
and [email protected]
that I could look at?
from karma-webpack.
I updated to [email protected]
and [email protected]
and it worked for me. Thanks!
from karma-webpack.
@dignifiedquire not working for me with [email protected]
and [email protected]
either
I've stripped everything down to a very basic config and a hello world test, repo is here - https://github.com/pojka/debug-karma-webpack-70
If you change to [email protected]
and [email protected]
the test runs
from karma-webpack.
Hi! [email protected] and [email protected] also did not work for me, so I downgraded to [email protected] and [email protected] and it triggers the following error (which I think is new in the current stack of error messages and might therefore have another cause):
WARN [preprocess]: Can not load "webpack"!
Error: Invalid arguments: 'delay'
at NodeWatchFileSystem.watch (/xxx/node_modules/webpack/lib/node/NodeWatchFileSystem.js:29:9)
at Watching.watch (/xxx/node_modules/webpack/lib/Compiler.js:86:47)
at Watching._done (/xxx/node_modules/webpack/lib/Compiler.js:82:8)
at Watching.<anonymous> (/xxx/node_modules/webpack/lib/Compiler.js:60:18)
at Tapable.emitRecords (/xxx/node_modules/webpack/lib/Compiler.js:279:37)
at Watching.<anonymous> (/xxx/node_modules/webpack/lib/Compiler.js:57:19)
at /xxx/node_modules/webpack/lib/Compiler.js:272:11
at Tapable.applyPluginsAsync (/xxx/node_modules/webpack/node_modules/tapable/lib/Tapable.js:60:69)
at Tapable.afterEmit (/xxx/node_modules/webpack/lib/Compiler.js:269:8)
at Tapable.<anonymous> (/xxx/node_modules/webpack/lib/Compiler.js:264:14)
with the karma.config
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: pathToSrcJS,
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
// project specific SETUP necessary for tests
'components_tests/setup.js',
// include all test files
'components_tests/test_index.js'
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'components_tests/test_index.js': ['webpack', 'coverage'],
'components_tests/setup.js': ['webpack']
},
// list of files to exclude
exclude: [],
// TODO refactor path and make them project agnostic
webpack: webpackConfig,
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// Output summary only to console
// Webstorm/Intellij have an integrated coverage view
coverageReporter: {
reporters: [{
type: 'text'
}]
},
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
plugins: [
require('karma-phantomjs-launcher'),
require('karma-webpack'),
require('karma-jasmine'),
require('karma-coverage')
]
});
};
from karma-webpack.
My problem was solved by upgrading to the latest version of webpack.
from karma-webpack.
Same issue here. I'm running a clone of https://github.com/pheuter/essential-react with
Full output of npm ls
here
from karma-webpack.
@claudiopro you need to upgrade karma to 0.13
from karma-webpack.
@dignifiedquire thanks, [email protected]
did solve the issue!
from karma-webpack.
@dignifiedquire that was indeed the issue, thank you for your patience!
from karma-webpack.
Closing this as all issues seem to have been resolved.
from karma-webpack.
Two ways to use karma start
.
-
if you had done
npm install -g karma-cli
, you can usekarma start
directly in commander(not in package.json) -
if you use npm scripts like
"scripts": {
"test": "karma start"
},
, try npm install -SD karma-webpack webpack
,then usenpm run test
from karma-webpack.
Related Issues (20)
- karma-webpack 5.0 No longer notified of compilation starting HOT 2
- Cannot read property 'entry' of undefined
- Cannot read property 'entry' of undefined
- karma-webpack 5 fails to read files with a query parameter (e.g. font-awesome) HOT 6
- 5.0 crashes on MacOS (Preprocessor, Plugin), fixed on master -> Release 5.1? HOT 7
- Trying to add karma-webpack to angular karma config HOT 2
- karma.conf.js being treated as entrypoint results in many errors from webpack 5 HOT 2
- Webpack Errors being reported twice.
- Process is not defined HOT 1
- Error during file loading or preprocessing HOT 7
- Webpack file cache isn't generated when webacpack watch option is false/nothing
- karma-webpack does not respect webpack mode = "production" HOT 3
- I have the same problem. HOT 1
- preprocessor change between v4 & v5 leading to error when used with karma-mocha HOT 15
- Issue with Webpack 5 unable to find file 404 (works with webpack 4) HOT 1
- Don't warn overriding [name].js to [name].js
- Figure out a publishing Github Workflow
- Ensure all project dependencies have no auditing issues
- Provide a migration path from karma-webpack
- Update the README.md
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-webpack.