Nuxt.js: Compilation problem does not report correctly when running in Teamcity (& likely other CIs)

Created on 17 Jun 2019  路  9Comments  路  Source: nuxt/nuxt.js

Version

v2.8.1

Reproduction link

https://codesandbox.io/s/codesandbox-nuxt-hvv2n

Steps to reproduce

  1. Create a default nuxt project and create a broken component - for example importing non-existing component (or download linked CodeSandbox project)

  2. Run to check for expected behaviour
    yarn install && yarn build && echo "should not see this"
    You will get nuxt fatal error and "should not see this" will not be printed.

  3. You can run same project in Teamcity to see build would succeed and no logs printed, but easier is to simulate this by setting env variable, e.g.
    export BUILD_NUMBER=123

  4. Clean up the directory and run the same command as 2. Rather than seeing build errors and skipped last command, the build will return 0 and will not print that it failed.

What is expected ?

  1. Even in quiet mode, I would expect the build to print compilation errors
  2. Build should fail with result code > 0

What is actually happening?

build quietly fails and returns 0 ("should not see this" is printed)

Additional comments?

As a current workaround, setting quiet:false in build section in nuxt.config.js enforces the behaviour in Teamcity to be same as usual, i.e. reports issues correctly in logs and with error code.

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

All 9 comments

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

This issue still occurs. To reiterate reproduce steps:

  1. Download the codesandbox content as ZIP.
  2. Simulate running in TeamCity: go to command line, export env variable (use set on windows)
export BUILD_NUMBER=123
  1. Run command to install dependencies, run build and check status:
yarn install && yarn build && echo "should not see this"

Build status returns 0 and no errors are reported, instead of failing as supposed to.

This should not be a stale issue. More time was spent on this than should have been necessary to figure out quiet: false would actually return the error.

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

BUMP. Reproduction is above. This is not a stale issue. The same issue still exists, nothing has changed. There needs to be one (or more) of the following in place:

  1. Notify the user that quiet: true is enabled, and that errors will return 0 which DOES NOT FAIL.
  2. set the default to quiet: false and notify the user that errors will cause failures.

Either one is sufficient.

This is still the same issue in edge.

Could someone from Nuxt team comment on this at least?
As far as I can see this is still present, meaning any Nuxt builds in CI environments are potentially unsafe. The fact that build does not report failure means that where there is automated deployment (commit -> CI build & test -> deploy), a broken app can be deployed as CI has no way of seeing that there was a breaking change. In fact this is exactly what happened to us.

There is a workaround, but it's not enabled by default. This issue needs to be fixed (IMO quiet should only impact verbosity of the logging, not build status reporting), or if that's too difficult/too low priority, at least the default could be changed so that CI works with default settings.

Thanks for reporting! #6075 should've fixed that.

Ahhh, good news :) Thanks, didn't notice the other issue.

NP and sorry for the delay :+1:

Closing here as it'll be fixed in the upcoming v2.9 (should be already present in nuxt-edge)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vadimsg picture vadimsg  路  3Comments

gary149 picture gary149  路  3Comments

VincentLoy picture VincentLoy  路  3Comments

surmon-china picture surmon-china  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments