Skip to content
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

Exit code 0 when the build fail? #290

Closed
2 of 4 tasks
alex-pex opened this issue Apr 3, 2017 · 3 comments
Closed
2 of 4 tasks

Exit code 0 when the build fail? #290

alex-pex opened this issue Apr 3, 2017 · 3 comments
Labels

Comments

@alex-pex
Copy link

alex-pex commented Apr 3, 2017

This issue is a:

  • Bug report
  • Feature request
  • Question / support request
  • Other

Hello,

I ran a strange issue with nwb on my production environment. I configured eslint-loader to be run with the build, but eslint-loader was a devDependency and was expected to fail on production.

On NODE_ENV=production, I ran npm run build and it failed with the message : "Module not found: Error: Can't resolve 'eslint-loader'". The problem is: the exit code is still 0 and my Travis tests didn't fail.

The latest version changelog says "Explicitly call process.exit(0) from the nwb command when there are no errors running a command [#262]", maybe it is related to this ?

node -v
v6.10.0

npm -v
3.10.10

nwb -v
v0.15.6
@insin
Copy link
Owner

insin commented Jun 1, 2017

Is there a repo I could use to repro this?

@alex-pex
Copy link
Author

alex-pex commented Jun 8, 2017

I don't have a repo to share, but here is what I do :

in index.js:

import renderApp from 'umbra/render';
import 'umbra/styles/material-theme.scss';
import 'umbra/styles/bootstrap-theme-vendor.scss';
import 'umbra/styles/bootstrap-theme-core.scss';
import 'aaa';

// eslint-disable-next-line no-restricted-properties
renderApp(document.getElementById('root'));

Then : npm run build && echo "it's alright" and I get :

√ Cleaning app
× Building React app

Failed to compile with 1 error.

 ERROR  in ./src/index.js
Module not found: Error: Cannot resolve module 'aaa' in (...)
 @ ./src/index.js 13:0-14
it's alright

@insin
Copy link
Owner

insin commented Jun 8, 2017

Thanks, looks like need to explicitly check for build errors after running a build instead of relying on Webpack calling back with an error (which must be reserved for genuine build failures, not completion with build errors).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants