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(angular): add workaround to prevent process from exiting early when building #5807

Merged
merged 1 commit into from
May 27, 2021

Conversation

leosvelperez
Copy link
Member

ISSUES CLOSED: #5729

Current Behavior

When building an Angular app with Nx using the @angular-devkit/build-angular, since version 12.0.1 there's a new implementation for the SASS compilation which uses workers to do the job. The implementation unref the worker early and that causes, in some environments (CI, Docker builds, where no TTY is available), to exit the process too early, and therefore, no compilation occurs. The Angular CLI is working because they rely (intentionally or not) on a setInterval running for analytics while the compilation is occurring, which keeps the event loop busy and prevents the process from exiting.

Expected Behavior

Building an Angular app with Nx should work correctly. A workaround is added (an empty interval) to keep the event loop busy, until the Angular CLI fixes the way workers are managed.

Related Issue(s)

Fixes #5729

@vercel
Copy link

vercel bot commented May 27, 2021

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/D7qEtDDCcoFDUdHVw9HJjA8ARw5K
✅ Preview: https://nx-dev-git-fork-leosvelperez-fix-ng-nx-build-nrwl.vercel.app

@nx-cloud
Copy link

nx-cloud bot commented May 27, 2021

Nx Cloud Report

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

📂 See all runs for this branch

Status Command
#000000 nx affected --target=build --parallel --max-parallel=3
#000000 nx affected --target=e2e
#000000 nx affected --target=lint --parallel --max-parallel=4
#000000 nx affected --target=test --parallel --max-parallel=2

Sent with 💌 from NxCloud.

@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 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build doesn't generate artifacts with @angular-devkit/[email protected]
1 participant