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 does not inherit the exit code of running the app: nest start #1044

Closed
loklaan opened this issue Feb 17, 2021 · 6 comments
Closed

Comments

@loklaan
Copy link

loklaan commented Feb 17, 2021

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behaviour

Similar to what was reported in #423, the next start exists with a code 0 regardless of what the underlying child process exits with.

Expected behaviour

The nest start command should exit with the code given by the child process.

Minimal reproduction of the problem with instructions

See loklaan/repro-nestcli__nest-start-exit-code

What is the motivation / use case for changing the behavior?

Have things like CI/CD pipelines function correctly when using nest start.

Worth mentioning that a workaround for this is as follows:

yarn nest build
node ./dist/main.js 

I'm guessing this is what everyone does right now. Or in most cases the dist in managed by pm2 etc.

Environment

MacOS / Linux (Ubuntu)

@loklaan
Copy link
Author

loklaan commented Feb 17, 2021

Am happy to get a PR together for this if this is in fact a bug!

@jmcdo29
Copy link
Member

jmcdo29 commented Feb 17, 2021

Would you mind putting those steps into a public repository that can be cloned?

@loklaan
Copy link
Author

loklaan commented Feb 17, 2021

@jmcdo29 No worries - added to OP

@jmcdo29
Copy link
Member

jmcdo29 commented Feb 17, 2021

I can definitely reproduce it, and it does seem to be coming from the CLI. Everything under the hood ends up going through commander, but if I remember right, process.exit(1) should bubble up through there, so it seems something else is at play.

@kamilmysliwiec
Copy link
Member

Fixed in this commit dd22171 and published as 7.5.5

@loklaan
Copy link
Author

loklaan commented Feb 17, 2021

Much appreciated @kamilmysliwiec 😍

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

No branches or pull requests

3 participants