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
Using --bail makes module build errors more cryptic. #711
Comments
Even more cryptic with loaders such as eslint-loader. Without
With
|
I find this to be an undesirable effect as well. |
Any pointers on how to fix this? We're having @sapegin 's problem. |
Any updates on this ? This is a real pain, --bail is needed so that CI builds will fail when they should. However tslint-loader will not tell why it's failing. This has been reported here : wbuchwalter/tslint-loader#18 For authors of loaders looking for a workaround, see how eslint-loader resolved this webpack-contrib/eslint-loader#53, by returning the errors or warnings in the exception message itself. e.g. https://github.com/MoOx/eslint-loader/blob/master/index.js#L73 |
AN issue with the workaround, when a loader returns an error and webpack bails, only the first error returns which could be tedious if you have a lot of errors and have to keep re running the build. Is there a way that webpack could allow a loader to report all errors and bail after all errors are known ? |
Hello ! Any news on this ? |
I don't have this problem. Either it depends on config (I also use eslint-loader), or it has been fixed. I have:
on Windows 10. |
Hey guys just wondering if there is any new update on this item? |
Also experiencing the same issue here. |
Here's a silly workaround. Given a webpack call without
The first run gives you the detailed feedback about the error, and the second ensures you get a non-zero exit code when there's an error. This shouldn't be necessary, and is a hack. |
Based on @jmitchell's suggestion, I do the following to enable Bash command chaining, but only print the pretty (non (webpack && webpack --bail > /dev/null 2>&1) && run_command_that_only_runs_on_webpack_success |
Any progress about this request? We will never build two times just to improve the logs... |
I'm trying to reproduce this but adding the |
I'm closing this issue since the problem is not reproducible using webpack 4 and webpack 3 is on maintenance mode. |
We use
--bail
so that webpack will report errors to our build script (without --bail, it doesn't give an error exit code).Unfortunately, when you use
--bail
, the error result from unparseable JavaScript loses the line that tells you what file the error occurred in.Example output without
--bail
:With
--bail
, the output looks like:Note that without --bail, the file with the syntax error (MyPage.js) is named, but not in the latter. This makes it hard to debug problems that come from our build script, because the error log does not tell us what file the problem is in.
The text was updated successfully, but these errors were encountered: