fix(testing): set moduleResolution to node in Cypress tsconfig to prevent TS5095 error #33726
+2
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When generating Cypress component testing in Angular workspaces, the base tsconfig sets moduleResolution to 'bundler' which causes TS5095 errors because 'bundler' requires module to be 'preserve' or 'es2015+'.
Cypress runs in Node.js and should use Node.js module resolution instead. This fix sets moduleResolution to 'node' for Cypress tsconfig.json templates.
Current Behavior
When generating Cypress component testing configuration in Angular workspaces, the generated
cypress/tsconfig.jsoninheritsmoduleResolution: "bundler"from the workspace base config. Since Cypress usesmodule: "commonjs"for Node.js runtime, this causes TypeScript compiler error TS5095: "Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."Expected Behavior
The generated
cypress/tsconfig.jsonshould explicitly setmoduleResolution: "node"to match themodule: "commonjs"setting, preventing TS5095 errors. This aligns with how NestJS applications handle the same issue (see #33607).