Skip to content

build(deps): bump nx 21.2.0 → 21.6.11 to fix fesm2022 source-map regression (ACE-7218) - #8

Merged
davidIce merged 1 commit into
support-bs-3from
fix/ACE-7218-nx-21.6.11-sourcemap
Jul 31, 2026
Merged

davidIce merged 1 commit into
support-bs-3from
fix/ACE-7218-nx-21.6.11-sourcemap

Conversation

@davidIce

Copy link
Copy Markdown

Reason

nx@21.2.0's @nx/angular:package executor emits fesm2022 source maps whose sources point at the ng-packagr tmp-esm2022/*.js intermediate instead of chaining back to the original .ts / external .html template.

For components with an external template (datepicker), Angular's Ivy linker (@angular/compiler-cli linker/babel tryExternalTemplate) then can't locate the template source and throws Cannot read properties of undefined (reading 'contents'). In a consumer building with the partial-compilation linker (fms Angular 20), the shared linker state leaks and this cascades into ~232 errors.

Change

  • Bump nx + all @nx/* devDeps 21.2.0 → 21.6.11 (nx fixed the source-map handling). ng-packagr unchanged at 20.0.0.
  • No nx.json / workspace migration required.

Verification

  • Rebuilt all 25 library entry points → every fesm2022 map now chains back to .ts + the external .html (zero tmp-esm2022 residue).
  • Link-tested all 25 fesm bundles against an unpatched Angular 20.3.26 Ivy linker → 25 OK / 0 crash.
  • Isolated the fix: reverting ng-packagr to 20.0.0 keeps the .ts maps, so the fix is exactly the nx bump.

Refs: ACE-7218

@davidIce
davidIce requested a review from a team as a code owner July 31, 2026 07:31
@davidIce
davidIce marked this pull request as draft July 31, 2026 07:43
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 991b4315-2cd7-4771-bb00-5e45d4871c1a

📥 Commits

Reviewing files that changed from the base of the PR and between a3ab722 and 157a238.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json

📝 Walkthrough

Walkthrough

The package metadata removes @nx/angular and @nx/node from dependencies. It updates nine Nx packages in devDependencies from version 21.2.0 to 21.6.11. It also updates the root nx package to version 21.6.11.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 31, 2026
@davidIce
davidIce force-pushed the fix/ACE-7218-nx-21.6.11-sourcemap branch from 157a238 to 10a8187 Compare July 31, 2026 07:52
@davidIce
davidIce marked this pull request as ready for review July 31, 2026 07:54
@davidIce
davidIce marked this pull request as draft July 31, 2026 07:59
@davidIce
davidIce force-pushed the fix/ACE-7218-nx-21.6.11-sourcemap branch from 10a8187 to 35f1e76 Compare July 31, 2026 08:02
@davidIce
davidIce marked this pull request as ready for review July 31, 2026 08:12
@davidIce
davidIce requested a review from mattwang44 July 31, 2026 08:12
@mattwang44

Copy link
Copy Markdown
Member

🤖 GoBuilders classification: L2 / R1 — pattern-clear build-toolchain dependency bump (nx 21.2.0 → 21.6.11), no application code and no product-behavior judgment; failure modes surface at build/link time and are reversible via revert, so no risk override fires.

@mattwang44 mattwang44 added gobuilders:L2 GoBuilders classification: L2 Solution Builder risk:R1 GoBuilders risk classification: R1 labels Jul 31, 2026

@mattwang44 mattwang44 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Suggested verdict: REQUEST_CHANGES

I reviewed this as a dependency-only PR. The nx 21.6.11 bump itself is a mature in-major release (published 2026-04-17), CI is fully green across build, lint, unit and e2e, and lockfile provenance checks out: every entry resolves to registry.npmjs.org with an integrity hash, and the only new install-script packages are unrs-resolver and nested fsevents, both expected. The blocker is scope: the committed package-lock.json was regenerated wholesale, changing 539 top-level entries where a minimal update needs 113, see the inline comment. Redoing the lockfile as a targeted update should be quick, and I'd expect to approve right after.

Comment thread package.json
Comment thread package.json
@mattwang44 mattwang44 added the rhapsody-rework AI reviewer left findings for the PR author to address label Jul 31, 2026
…ression

[why]
nx 21.2.0's @nx/angular:package executor emits fesm2022 source maps whose
`sources` point at the ng-packagr `tmp-esm2022/*.js` intermediate instead of
chaining back to the original `.ts`/external `.html` template. For components
with an external template (datepicker), Angular's Ivy linker
(`@angular/compiler-cli` linker/babel `tryExternalTemplate`) then fails to
locate the template source and throws `Cannot read properties of undefined
(reading 'contents')`, which cascades into hundreds of linker errors in
consumers building with the partial-compilation linker (e.g. fms Angular 20).

nx 21.6.11 fixes the source-map handling; rebuilt fesm2022 maps chain back to
`.ts` + the external `.html`, and all 25 entry points link cleanly on the
unpatched Angular 20.3.26 linker.

[how]
- Bump `nx` + all `@nx/*` deps 21.2.0 -> 21.6.11 IN PLACE (no dependencies <-> devDependencies moves; @nx/angular and @nx/node stay in `dependencies`). ng-packagr unchanged at 20.0.0.
- Add `ts-node@10.9.1` to devDependencies: it was previously in the tree only
  transitively (at this exact version) via the nx 21.2.0 toolchain and is
  required by jest's `jest.config.ts` loader; the 21.6.11 tree no longer
  provides it transitively, so unit tests failed with
  "'ts-node' is required for the TypeScript configuration files".
- Lockfile is a MINIMAL update: restored the base package-lock.json and ran a
  plain `npm install`. App-facing deps (jest 29.7.0, webpack 5.99.8,
  sass-embedded, @types/node, ts-jest, jest-preset-angular) are unchanged; the
  touched entries are the nx-21.6.11 + ts-node transitive closure only.
- No workspace/nx.json migration required.

Refs: ACE-7218

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@davidIce
davidIce force-pushed the fix/ACE-7218-nx-21.6.11-sourcemap branch from 35f1e76 to 1d3b63f Compare July 31, 2026 13:43
@davidIce
davidIce requested a review from mattwang44 July 31, 2026 13:44

@mattwang44 mattwang44 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Suggested verdict: APPROVE

I re-verified both of my earlier findings against 1d3b63f empirically, not just from the replies. The lockfile is now exactly the minimal update: 113 changed top-level entries, matching my own npm install --package-lock-only replay of base lockfile + new package.json, with jest, webpack, sass-embedded, @types/node and friends unchanged at base versions; provenance is still clean (all registry.npmjs.org with integrity, no new install scripts beyond unrs-resolver and nested fsevents). The deps/devDeps move is undone and ts-node@10.9.1 is disclosed with a clear why in the commit body. Unit tests and e2e smoke were still running at review time; everything that has finished is green, and this head is a strict reduction of the previously all-green diff.

@mattwang44
mattwang44 dismissed their stale review July 31, 2026 13:49

Superseded by my updated review (suggested verdict: APPROVE).

@davidIce
davidIce merged commit e2722b8 into support-bs-3 Jul 31, 2026
11 checks passed
@davidIce
davidIce deleted the fix/ACE-7218-nx-21.6.11-sourcemap branch July 31, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gobuilders:L2 GoBuilders classification: L2 Solution Builder rhapsody-rework AI reviewer left findings for the PR author to address risk:R1 GoBuilders risk classification: R1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants