-
Notifications
You must be signed in to change notification settings - Fork 220
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
CommonsChunkPlugin and "Path doesn't exist " error #91
Comments
I had the same problem, and I resolved it this way : // in my karma.config.js file
var webpackConfig = require('./webpack.config'); // require the project webpack config (it's just node js module, so you can require it)
webpackConfig.plugins = []; // by overriding plugins, we remove CommonsChunkPlugin
webpackConfig.entry = ""; // you can override anything you want from the project webpack config
// Karma config
module.exports = function (config) {
config.set({
...
preprocessors: {
'tests.bundle.js': ['webpack']
},
webpack: webpackConfig,
... By doing this, it is Karma who makes the choices and disable what should be disabled. |
Great! It is a good workaround nonetheless and I have already included it in my project. However I still feel that this could be a great addition to the module to power development transparency. And also to save X headache hours of future developers that stumble upon this same issue |
I think having a separate Maybe adding better error reporting so you can better determine the plugin causing errors or documenting known supported plugins would be the best route. |
I'm going to close this and open an issue to note to add supported plugins to docs. |
Hi guys, I am trying to unit-test my Angular/Webpack client app with Karma and I am having this issue:
Path doesn't exist '/_karma_webpack_/tests/client/bundle.js'
The full stacktrace is:
My
webpack.config.js
plugins section is as follows:This issue gets resolved if I remove the CommonsChunksPlugin. I know that the commons plugin is useless for testing (as it don't affect execution), but it is extremely ugly to add a "if process.env.NODE_ENV === 'test'" condition on the webpack config file, besides considering that if it is so useless to the testing process, then I think it should be
karma-webpack
who makes that choice and disables it transparently to the developer.What do you guys thinks? Is there any temporal workaround for this that I am not aware of?
The text was updated successfully, but these errors were encountered: