Skip to content

bug(nav): NoopAnimationsModule in @angular/material:nav test doesn't work when animation module isn't added #30560

Closed
@sixcorners

Description

@sixcorners

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

ng add @angular/material as of 19.2 no longer adds the angular animation module.
ng generate @angular/material:nav's spec still imports the NoopAnimationsModule.

      imports: [NoopAnimationsModule]

I think that causes

./node_modules/@angular/platform-browser/fesm2022/animations.mjs:11:0-50 - Error: Module not found: Error: Can't resolve '@angular/animations/browser' in '/home/runner/work/tso-tools/tso-tools/node_modules/@angular/platform-browser/fesm2022'

Reproduction

ng new test --style=scss --ssr=false
cd test
ng add @angular/material --skip-confirmation --theme purple-green --typography
ng generate @angular/material:nav room
npm test -- --no-watch --no-progress --browsers=ChromeHeadless --code-coverage

Expected Behavior

tests run

Actual Behavior

./node_modules/@angular/platform-browser/fesm2022/animations.mjs:11:0-50 - Error: Module not found: Error: Can't resolve '@angular/animations/browser' in '/home/runner/work/tso-tools/tso-tools/node_modules/@angular/platform-browser/fesm2022'

Environment

  • Angular: 19.2.?
  • CDK/Material: 19.2.1
  • Browser(s): ChromeHeadless
  • Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: ng-generateSchematics that generate code in user projects

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions