Skip to content

Conversation

@rainerhahnekamp
Copy link
Contributor

Angular Schematics still run under CommonJS. That's why the tsconfig.schematics.json, has to revert its output via moduleResolution: "node".

This fix has been successfully tested locally, via publishing to verdaccio and doing a fresh installation via npx ng add @ngrx/schematics.

As a follow-up/separate issue,I would suggest introducing a integration test, which creates a new Angular workspace and executes the schematics on it.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

Closes #5050

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

…lity

Changes tsconfig.schematics.json to output CommonJS modules instead of
ES modules. Angular schematics run in Node.js which expects CommonJS
format by default.

Fixes #5050
@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for ngrx-io ready!

Name Link
🔨 Latest commit 7af59bc
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-io/deploys/69453af5fb46a80008641836
😎 Deploy Preview https://deploy-preview-5051--ngrx-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for ngrx-site-v21 ready!

Name Link
🔨 Latest commit 7af59bc
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-site-v21/deploys/69453af5c37c330008410558
😎 Deploy Preview https://deploy-preview-5051--ngrx-site-v21.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

Thanks, good catch! I think we also should also update this for the other *.schematics.json files as well.

@rainerhahnekamp
Copy link
Contributor Author

@timdeschryver seems that moduleResolution & module: node is not enough anymore and we need the hybrid mode (ESM + CJS) that nodenext provides 🤯
Either way, I've also changed the @ngrx/schematics to nodenext and did a local test run with npx ng add @ngrx/schematics. Also worked.

@timdeschryver timdeschryver merged commit 7819972 into main Dec 20, 2025
14 checks passed
@timdeschryver timdeschryver deleted the fix/schematics/revert-to-common-js branch December 20, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng add @ngrx/schematics@21 fails with ES module warning

4 participants