Navigation Error in angular2

Vignesh picture Vignesh · Mar 24, 2017 · Viewed 11.7k times · Source

I have updated the angular packages version from 2.4.10 to 4.0.0 after updating i am getting the following errors while navigating.

ERROR Error: Uncaught (in promise): Error: Found the synthetic property @transformPlaceholder. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.
Error: Found the synthetic property @transformPlaceholder. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application

And i changed the webpack.common.js configuration. see the below code

 new webpack.ContextReplacementPlugin(
            // The (\\|\/) piece accounts for path separators in *nix and Windows
            /angular(\\|\/)core(\\|\/)@angular/,
            helpers.root('./src'), // location of your src
            {} // a map of your routes
        ),

Answer

Vignesh picture Vignesh · Mar 24, 2017

I have fixed the issue. I added a new package: @angular/animations.

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

And I imported the module:

@NgModule({
    imports: [
        BrowserAnimationsModule
    ]
})