Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to fix Error: export 'ɵsupportsWebAnimations'

Tags:

angular

im trying to replicate this component:

stackblitz.com/edit/angular-material-star-rating?file=package.json

however, on my project im unable to run it due to the following errors:

./node_modules/@angular/platform-browser/fesm2015/animations.mjs:533:9-31 - Error: export 'ɵsupportsWebAnimations' (imported as 'ɵsupportsWebAnimations') was not found in '@angular/animations/browser' (possible exports: AnimationDriver, ɵAnimation, ɵAnimationEngine, ɵAnimationStyleNormalizer, ɵNoopAnimationDriver, ɵNoopAnimationStyleNormalizer, ɵWebAnimationsDriver, ɵWebAnimationsPlayer, ɵWebAnimationsStyleNormalizer, ɵallowPreviousPlayerStylesMerge, ɵcontainsElement, ɵinvokeQuery, ɵvalidateStyleProperty)

./node_modules/@angular/platform-browser/fesm2015/animations.mjs:533:69-88 - Error: export 'ɵCssKeyframesDriver' (imported as 'ɵCssKeyframesDriver') was not found in '@angular/animations/browser' (possible exports: AnimationDriver, ɵAnimation, ɵAnimationEngine, ɵAnimationStyleNormalizer, ɵNoopAnimationDriver, ɵNoopAnimationStyleNormalizer, ɵWebAnimationsDriver, ɵWebAnimationsPlayer, ɵWebAnimationsStyleNormalizer, ɵallowPreviousPlayerStylesMerge, ɵcontainsElement, ɵinvokeQuery, ɵvalidateStyleProperty)

i have already did the

npm install --save @angular/material @angular/cdk @angular/animations --force
like image 524
nhoyti Avatar asked Oct 29 '25 07:10

nhoyti


2 Answers

If you already had a package.json file in your project all you needed to do is run:

  1. npm i to install all the declared dependencies on the project
  2. npm run serve to serve your Angular application.

I can also see that project is quite old (Angular 5, we're currently on Angular 13) so perhaps you'll need to migrate some code to the current version you're using

like image 53
Some random IT boy Avatar answered Oct 31 '25 00:10

Some random IT boy


I changed @angular/animations version and I solved this problem.

on package.json,

"@angular/animations": "13.0.1",
"@angular/cdk": "13.0.1",
"@angular/common": "13.0.1",
"@angular/compiler": "13.0.1",
"@angular/core": "13.0.1",
"@angular/forms": "13.0.1",
"@angular/language-service": "13.0.1",
"@angular/platform-browser": "13.0.1",
"@angular/platform-browser-dynamic": "13.0.1",
"@angular/router": "13.0.1",

When @angular/animations version is 13.2.3 (latest), same problem has occurred. Fix your version same with angular version.

like image 38
DongJae Lee Avatar answered Oct 30 '25 23:10

DongJae Lee