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
fix(core): fix postinstall failure due to project graph build error #9960
fix(core): fix postinstall failure due to project graph build error #9960
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Hi guys, How can I rerun the checks? According to the logs they failed due to a timeout: |
Delegate error handling to calling functions and avoid `process.exit(1)`, which causes the package's postinstall stage to fail if there are problems with the project graph Closes nrwl#9451
6bb1608
to
2d35a2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. This was added here a long time ago when we didn't have a clean way to handle error messages. Throwing the error instead of exiting the process should do no further harm.
Thank you for your contribution. LGTM 🎉
Great, thanks a lot @FrozenPandaz! |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
The
postinstall
hook of thenx
package fails if aproject.json
file is missing. This can happen, e.g., during a Docker build, when the layer used fornpm install
/npm ci
only contains the workspace definition files (workspace.json
,package.json
, etc.) to enable caching of this step (see this comment for details).Expected Behavior
The
postinstall
step no longer fails, becausebuildProjectGraphWithoutDaemon()
no longer exits the process with an error code (process.exit(1)
) and, thus, allows the init script to catch the error.@ Nx maintainers: I don't know why the
process.exit(1)
call was introduced in the first place. Thus, I don't know if removing it has any undesired side effects. In case there are any, please inform me what needs to be fixed.Related Issue(s)
Fixes #9451