Nuxt.js: nuxt build no throw error when process.env.CI = true

Created on 29 Apr 2019  路  4Comments  路  Source: nuxt/nuxt.js

Version

v2.6.3

Reproduction link

https://github.com/nuxt/nuxt.js/blob/dev/packages/webpack/src/builder.js#L150

Steps to reproduce

  • In Travis CI, the process.env.ci is true
  • nuxt build, expect error happened, but build complete without error

What is expected ?

throw the error

What is actually happening?

return the Promise.reject but no catch

Additional comments?

For now, the workaround is using the module https://github.com/echoulen/nuxt-build-error-catch-plugin to catch the Promise.reject

This bug report is available on Nuxt community (#c9131)
bug-report pending

All 4 comments

Oh just got the same issue.

I am using GitLab CI, didn't even notices, but it seems that GitLab CI automatically defines this CI environment variable. As result my build exited without error, but produced no build. I was wondering, what is happening, because I didn't noticed error on my local machine...

This is kinda not good... I expect that CI Pipeline fails, if build is not generated properly. Please fix it

We just ran into the same issue. I solved it by setting build.quiet to false.

Here you can see an example of the build being green, without any error, while our master branch was currently broken at the time: https://gitlab.com/gitlab-org/design.gitlab.com/-/jobs/252288505

Screenshot 2019-07-16 at 11 04 15

Here is the commit, where I turned on build.quiet: false: https://gitlab.com/gitlab-org/design.gitlab.com/-/jobs/252363564

Screenshot 2019-07-16 at 11 07 16

So in summary, our SCSS compilation failed and it didn't lead to build errors, because build.quiet is per default true on CI which leads to this error.

  1. I am wondering why the default is true, who doesn't want build output during the CI job?
  2. Also the problem: Why does it swallow the error?

My tone might sound a bit harsh, not intended, just didn't have my coffee yet 馃槅 Thank you for the great work on nuxt!

/cc @clarkdo

I鈥檒l have a look shortly

Was this page helpful?
0 / 5 - 0 ratings

Related issues

o-alexandrov picture o-alexandrov  路  3Comments

bimohxh picture bimohxh  路  3Comments

surmon-china picture surmon-china  路  3Comments

gary149 picture gary149  路  3Comments

bimohxh picture bimohxh  路  3Comments