Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular NoopAnimationsModule Type Error matches Element is not a function

I'm getting this error after importing NoopAnimationsModule for my Angular 6 app

ERROR TypeError: this.driver.matchesElement is not a function
    at TransitionAnimationEngine.push../node_modules/@angular/animations/fesm5/browser.js.TransitionAnimationEngine.processLeaveNode (browser.js:2976)
like image 931
ThilanCosta Avatar asked Jun 24 '18 06:06

ThilanCosta


3 Answers

This happened to me a few hours ago, and was probably caused by some outdated modules.

Running npm update --save fixed it.

like image 153
Adrien Avatar answered Oct 22 '22 23:10

Adrien


@angular/core and @angular/animations should be same version.
Especially look for "^" symbol in package name in package.json.

It should be

"@angular/core": "6.0.5",
"@angular/animations": "6.0.5",

and not like

"@angular/core": "6.0.5",
"@angular/animations": "^6.0.5",
like image 32
Arun Avatar answered Oct 23 '22 00:10

Arun


Had the same problem after adding the BrowserAnimationsModule. Fixed by putting in the correct order the imports of BrowserAnimationsModule the app.module.ts: imports: [ BrowserModule, AppRoutingModule, **BrowserAnimationsModule**, MatDialogModule, FormsModule, ReactiveFormsModule, HttpClientModule,

like image 2
albanx Avatar answered Oct 23 '22 00:10

albanx