I get this error when adding animations into my application.
I found: Angular 4 - Import BrowserAnimationsModule or NoopAnimationsModule. I added the entries to systemjs.config.js:
'@angular/animations': 'node_modules/@angular/animations/bundles/animations.umd.min.js',
'@angular/animations/browser':'node_modules/@angular/animations/bundles/animations-browser.umd.js',
'@angular/platform-browser/animations': 'node_modules/@angular/platform-browser/bundles/platform-browser-animations.umd.js'
I added the imports to app.module.ts (root module):
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
],
declarations: [
...
],
bootstrap: [
AppComponent
],
providers: [
...
]
})
export class AppModule { }
And I also installed the animations package:
npm install @angular/animations@latest --save
What might I be missing?
edit: I know this question looks very much like an exact duplicate of the question I linked, which has various answers. Going through them didn't help though, which is why I am asking for something I am overlooking.
edit2: I also checked Importing BrowserAnimationsModule Throws 404 - SystemJS Config Issue? which aimed at the same solutions already named in Angular 4 - Import BrowserAnimationsModule... (above)
edit3: As the comments mentioned: I have imported BrowserModule and BrowserAnimationsModule. The code section above was updated to reflect that.
edit4: As I have the animations in a child module of my application, I tried all three variants: Doing the imports in the root module, importing in the child module and importing in both.
edit5:
I checked the package versions with npm outdated and, reading How to update the angular2 version to the latest, found out about this bug: npm update --save
duplicates devDependencies as dependencies. I realized I had always been updating my packages with npm update --save
, that's why many packages were outdated. Sadly now they are up2date but it's still not working.
Package Current Wanted Latest Location
@types/jasmine 2.5.36 2.5.36 2.5.52 kidzpointz
@types/node 6.0.78 6.0.78 8.0.1 kidzpointz
jasmine-core 2.4.1 2.4.1 2.6.4 kidzpointz
protractor 4.0.14 4.0.14 5.1.2 kidzpointz
rxjs 5.0.1 5.0.1 5.4.1 kidzpointz
systemjs 0.19.40 0.19.40 0.20.14 kidzpointz
tslint 3.15.1 3.15.1 5.4.3 kidzpointz
typescript 2.4.0 2.4.0 2.3.4 kidzpointz