karma-webpack: bail option does not exit the process
If I use the bail option I get this error
Hash: 8344a6c0a9b3c44a5636
Version: webpack 1.10.3
Time: 27501ms
ERROR in ./lib/forgot-password/client/view.coffee
Module not found: Error: Cannot resolve module 'component-eemitter' in /home/vagrant/lib/forgot-password/client
@ ./lib/forgot-password/client/view.coffee 7:10-39
Hash: 8344a6c0a9b3c44a5636
Version: webpack 1.10.3
Time: 477ms
ERROR in ./lib/forgot-password/client/view.coffee
Module not found: Error: Cannot resolve module 'component-eemitter' in /home/vagrant/lib/forgot-password/client
@ ./lib/forgot-password/client/view.coffee 7:10-39
and then nothing happens, but the process is still alive. After 5 minutes I stopped it.
If I run webpack only with --bail it works fine.
maybe related to #49
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 2
- Comments: 31 (6 by maintainers)
Commits related to this issue
- fix: honor webpack's `bail` by emulation inside plugin As long as #66 (which is about `bail` not being honored by webpack) is not fixed, we can emulate equivalent behavior inside the plugin as an alt... — committed to aboks/karma-webpack by aboks 4 years ago
- Make sure Karma exits with non-zero if Webpack fails to build test code. See https://github.com/ryanclark/karma-webpack/issues/66 — committed to lume/cli by trusktr 4 years ago
@Ivaylo-Lafchiev I’ve been using this plugin lately:
Hope it helps.
👍 Facing this issue as well 😕
I wrote and published a plugin on NPM that solves this problem for my own needs. It propagates warnings and errors up to the console and ends the process with a non-zero exit code if it encounters an error. If anyone else is interested in it, it’s webpack-karma-die-hard.
Workarounds aside, we should be respecting the bail option inside the loader no?
Could we have an update on this issue? At some point it was assigned, supposed to go out in 2.0.4, but then it was unassigned. It still has a hotlist label. Is there any plan to fix this issue?
I’ve moved this into the org maintainers priority list. One of us, most likely me will get this sorted and out in
2.0.4@d3viant0ne Most certainly! I kind of just pinned those plugins for reference thinking they might be useful while investigating a fix. I’d say this is a pretty high priority fix. I’d hate to have something deploy even though tests fail.
As mentioned in #49, these two plugins might help solving this issue:
https://gist.github.com/Stuk/6b574049435df532e905 https://gist.github.com/mvgijssel/d3b121ad50e34c09a124
I’ve prepared a minimal repo where you can reproduce the issue.
https://github.com/ertrzyiks/karma-webpack-failed-compilation-example
It still going to stay in the milestone so I can at the very least remember to cover the use case with a few integration tests.