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

docs(angular): document PNPM workaround for ngcc #18100

Closed
wants to merge 1 commit into from

Conversation

daniel-shuy
Copy link
Contributor

@daniel-shuy daniel-shuy commented Jul 13, 2023

Current Behavior

Currently, https://nx.dev/recipes/other/setup-incremental-builds-angular#requirements still warns that ngcc doesn't support PNPM.

Expected Behavior

While ngcc doesn't support PNPM out-of-the-box, PNPM has since added a node-linker=hoisted mode that creates flat node_modules without symlinks, similar to the node_modules created by NPM, allowing ngcc to work with PNPM (angular/angular#50735).

Unfortunately, using node-link=hoisted breaks @parcel/watcher that is used by NX (#16319 and parcel-bundler/watcher#142). A workaround is to explicitly declare node-gyp-build in package.json, e.g.

{
  ...
  "devDependencies": {
    ...
    "node-gyp-build": "4.6.0",
    ...
  }
  ...
}

This PR documents the workarounds to use ngcc with PNPM.

p.s. Huge thanks to @DzmVasileusky for discovering the workarounds.

@daniel-shuy daniel-shuy requested a review from a team as a code owner July 13, 2023 09:19
@vercel
Copy link

vercel bot commented Jul 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2023 4:25am

@nx-cloud
Copy link

nx-cloud bot commented Jul 13, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 302547f. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@daniel-shuy
Copy link
Contributor Author

I don't understand why the build is failing, there are no error messages in the build console logs

@isaacplmann
Copy link
Collaborator

Needed to run nx format and commit the changes, but I couldn't apply my changes on top of your PR, so I made #19041.

If you run nx format and push your changes before the other PR merges, I'll close that PR. Otherwise, I'll close this one. You're still listed as an author on the commit on the other PR.

@isaacplmann isaacplmann self-assigned this Sep 7, 2023
@isaacplmann
Copy link
Collaborator

Closed in favor of #19041

@isaacplmann isaacplmann closed this Sep 7, 2023
@daniel-shuy
Copy link
Contributor Author

No worries, thanks for helping to fix it!

@daniel-shuy daniel-shuy deleted the patch-1 branch September 7, 2023 14:52
@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 Sep 13, 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.

2 participants