Skip to content

fix: CXSPA-11733 Issues with SSR Cypress E2Es#20996

Merged
pawelfras merged 1 commit intoepic/angular-21-upgradefrom
fix/CXSPA-11823
Jan 13, 2026
Merged

fix: CXSPA-11733 Issues with SSR Cypress E2Es#20996
pawelfras merged 1 commit intoepic/angular-21-upgradefrom
fix/CXSPA-11823

Conversation

@pawelfras
Copy link
Copy Markdown
Contributor

@pawelfras pawelfras commented Jan 12, 2026

Cypress tets for SSR were failing due to unexpected NG0205: Injector has already been destroyed
image
Link to example failing check: https://github.com/SAP/spartacus/actions/runs/20916679856/job/60093114689?pr=20946

Issue was resolved by moving provideZoneChangeDetection from deprecated platformBrowserDynamic in main.ts to the app.module.ts, where this config should land, based on the Angular Team recommendation.

Apart from that change, the following was changed (not related to the SSR issue)

QA steps:

  1. how to reproduce failing tests
  • go to epic/angular-21-upgrade
  • build libs, storefrontapp with SSR mode and serve SSR app with CI config
npm run build:libs
npm run build:ssr
npm run serve:ssr:ci
  • in cypress.config.ts, change e2e.baseUrl to http://localhost:4000
e2e: {
  // We've imported your old cypress plugins here.
  // You may want to clean this up later by importing these.
  setupNodeEvents(on, config) {
    return require('./cypress/plugins/index.js')(on, config);
  },
-  baseUrl: 'http://localhost:4200',
+  baseUrl: 'http://localhost:4000',
},
  • in second terminal, run Cypress
npm run e2e:open
  • run failing ssr/product-listing-page.e2e.cy.ts
  • in the terminal where app with SSR was served, verify if error NG0205 occured
  1. test the fix
  • go to fix/CXSPA-11823
  • repeat all above stepst for building and running app and Cypress
  • run previously failing ssr/product-listing-page.e2e.cy.ts and verify if all tests passed

@pawelfras pawelfras requested a review from a team as a code owner January 12, 2026 13:53
@github-actions
Copy link
Copy Markdown
Contributor

🚨 PR Title Validation Failed 🚨

Your pull request title does not follow the required format. Please update it to match the expected pattern:

Expected format:
<type>: <subject>

Allowed Types

  • docs: Changes to documentation only
  • feat: New feature work
  • fix: Bug fixes
  • perf: Code improvements for performance
  • refactor: Code changes that are not bug fixes or features
  • style: Code style changes (e.g., whitespace, formatting)
  • test: Adding or updating tests
  • chore: Build, CI, scripts, configs, etc.

Example of a valid PR title

feat: Add user authentication
fix: Resolve checkout bug
docs: Update API documentation

Merge is blocked until the PR title is corrected.

@pawelfras pawelfras changed the title fix CXSPA-11733 Issues with SSR Cypress E2Es fix: CXSPA-11733 Issues with SSR Cypress E2Es Jan 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚨 PR Title Validation Failed 🚨

Your pull request title does not follow the required format. Please update it to match the expected pattern:

Expected format:
<type>: <subject>

Allowed Types

  • docs: Changes to documentation only
  • feat: New feature work
  • fix: Bug fixes
  • perf: Code improvements for performance
  • refactor: Code changes that are not bug fixes or features
  • style: Code style changes (e.g., whitespace, formatting)
  • test: Adding or updating tests
  • chore: Build, CI, scripts, configs, etc.

Example of a valid PR title

feat: Add user authentication
fix: Resolve checkout bug
docs: Update API documentation

Merge is blocked until the PR title is corrected.

Copy link
Copy Markdown
Contributor

@sdrozdsap sdrozdsap left a comment

Choose a reason for hiding this comment

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

LGTM!
QA ✅

@pawelfras pawelfras merged commit 3e1d2f7 into epic/angular-21-upgrade Jan 13, 2026
16 of 18 checks passed
@pawelfras pawelfras deleted the fix/CXSPA-11823 branch January 13, 2026 09:04
sdrozdsap added a commit that referenced this pull request Jan 14, 2026
Nx migration:
- "@nx/angular" bumped to 22.3.1
- "@nx/devkit" bumped to 22.3.1
- "@nx/eslint-plugin" bumped to 22.3.1
- "@nx/jest" bumped to 22.3.1
- "@nx/workspace" bumped to 22.3.1
- "nx" bumped to 22.3.1

Angular migration:
- "@angular/core" bumped to 21.0.8
- "@angular/animations" bumped to 21.0.8
- "@angular/common" bumped to 21.0.8
- "@angular/compiler" bumped to 21.0.8
- "@angular/forms" bumped to 21.0.8
- "@angular/platform-browser" bumped to 21.0.8
- "@angular/platform-browser-dynamic" bumped to 21.0.8
- "@angular/platform-server" bumped to 21.0.8
- "@angular/router" bumped to 21.0.8
- "@angular/service-worker" bumped to 21.0.8
- "@angular/cli" bumped to 21.0.5
- "@angular/compiler-cli" bumped to 21.0.8
- "@angular/language-service" bumped to 21.0.8
- "@angular/ssr" bumped to 21.0.5
- "@angular/pwa" bumped to 21.0.5
- "@angular/build" bumped to 21.0.5
- "@angular-devkit/build-angular" bumped to 21.0.5
- "@angular-devkit/core" bumped to 21.0.5
- "@angular-devkit/schematics" bumped to 21.0.5
- "@schematics/angular" bumped to 21.0.5
- "@angular-builders/custom-esbuild" bumped to 21.0.0-beta.1
- "ng-packagr" bumped to 21.0.1
- "zone.js" bumped to 0.16.0

Angular ESLint:
- "@angular-eslint/builder" bumped to 21.1.0
- "@angular-eslint/eslint-plugin" bumped to 21.1.0
- "@angular-eslint/eslint-plugin-template" bumped to 21.1.0
- "@angular-eslint/schematics" bumped to 21.1.0
- "@angular-eslint/template-parser" bumped to 21.1.0
- "@angular-eslint/test-utils" bumped to 21.1.0
- "@angular-eslint/utils" bumped to 21.1.0

NgRx:
- "@ngrx/effects" bumped to 21.0.1
- "@ngrx/operators" bumped to 21.0.1
- "@ngrx/router-store" bumped to 21.0.1
- "@ngrx/store" bumped to 21.0.1
- "@ngrx/store-devtools" bumped to 21.0.1

Other dependencies:
- "@ng-select/ng-select" bumped to 21.1.4
- "ngx-infinite-scroll" bumped to 21.0.0
- "jest-preset-angular" bumped to 16.0.0

Build issues:
- added global type augmentations for `@HostListener` decorators with platform event syntax
  see: #20967
- fixed declaration-merging builder for ng-packagr v21 output structure change
- updated tsconfig files: changed `module` from `es2022` to `preserve`, added `moduleResolution: bundler`
- removed `lib: ["es2022", "dom"]` from tsconfig.lib.json files
- removed `isolatedModules` from tsconfig.spec.json files
- disabled `prefer-control-flow` ESLint rule

Unit tests:
- replaced `BrowserDynamicTestingModule`/`platformBrowserDynamicTesting` with `BrowserTestingModule`/`platformBrowserTesting`
- added `provideZoneChangeDetection()` via custom `ZoneChangeDetectionModule` in all test config files
- updated snapshots across multiple libraries
- fixed failing unit tests (checkout components, HorizontalScrollingPositionDirective, guest registration form)
- added `transformIgnorePatterns` to jest schematics configs to support ESM modules

Schematics:
- Installation and migration docs adjustments 
see: #20970
- Installation script update 
see: #20987
- Remove redundant 'applyClassicNamingConvention' from schematics 
see: #20986
- add missing semicolon in the generated app server.ts 
see: #20988
- Updated schematics snapshots

**SSR:**
- Issues with SSR Cypress E2Es 
see: #20996
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.

2 participants