Search code examples
node.jsangularwebpack-2typescript2.1

Navigation Error in angular2


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
        ),

Solution

  • 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
        ]
    })