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

fix(js): return success false if tsc compilation fails #9438

Conversation

AgentEnder
Copy link
Member

@AgentEnder AgentEnder commented Mar 21, 2022

Current Behavior

compileTypescript throws an error if compilation fails. This causes Node 14 + 12 to hang if compileTypescript is invoked by an async function, since unhandled promise rejections do not cause the process to fail.

Expected Behavior

compileTypescript reports success: false on build failures.

Related Issue(s)

Fixes #9046
Fixes #9251

@nx-cloud
Copy link

nx-cloud bot commented Mar 21, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit c53cb21. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 21 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Mar 21, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/GSGpduWMpVxaRQdTStydvK23odE8
✅ Preview: Canceled

@AgentEnder AgentEnder merged commit 9261105 into nrwl:master Mar 21, 2022
@AgentEnder AgentEnder deleted the fix/unhandled-promise-rejection-in-compile-tsc-files branch March 21, 2022 20:39
@johnameyer
Copy link

@AgentEnder should there be some sort of test to prevent recurrence?

@AgentEnder
Copy link
Member Author

Yeah, we'll be looking into some kind of testing for this. At the unit test level its not an easy thing to do, but some follow up PR can include an e2e test for similar scenarios. In particular, this one only fails if on Node 14 or below, since unhandled promise rejections don't propagate errors up.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants