primeng icon indicating copy to clipboard operation
primeng copied to clipboard

PrimeNG 4.0.0-rc.1 error: Found the synthetic property @dialogState. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application

Open mustafaekim opened this issue 9 years ago • 15 comments

Just upgraded to Angular 4.0.0 and primeng 4.0.0-rc.1.

I am getting the error below:

ERROR Error: Found the synthetic property @dialogState. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application. at checkNoSyntheticProp (dom_renderer.ts:368) [angular] at DefaultDomRenderer2.setProperty (dom_renderer.ts:311) [angular] at DebugRenderer2.setProperty (services.ts:883) [angular] at setElementProperty (ng_content.ts:1) [angular] at checkAndUpdateElementValue (element.ts:310) [angular] at checkAndUpdateElementInline (element.ts:208) [angular] at checkAndUpdateNodeInline (view.ts:448) [angular] at checkAndUpdateNode (view.ts:416) [angular] at debugCheckAndUpdateNode (services.ts:235) [angular] at debugCheckRenderNodeFn (services.ts:328) [angular] at Object.eval [as updateRenderer] (ConfirmDialog.html:2) [angular] at Object.debugUpdateRenderer [as updateRenderer] (services.ts:307) [angular] at checkAndUpdateView (view.ts:391) [angular] at callViewAction (view.ts:699) [angular]

mustafaekim avatar Mar 24 '17 14:03 mustafaekim

fixed by:

If you rely on Animations you’ll also need to install the animations package @angular/animations and import the new BrowserAnimationsModule from @angular/platform-browser/animations in your root NgModule.

mustafaekim avatar Mar 24 '17 14:03 mustafaekim

I'm too ...

cmargulhano avatar Mar 24 '17 16:03 cmargulhano

@mustafaekim Where to import BrowserAnimationsModule in this project please? https://github.com/pavel-sindelka/astronauts

I try import it in app.module.ts but still not works.

import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {HttpModule} from '@angular/http';

import {AppComponent} from './app.component';
import {routing} from './app.router';
import {SharedModule} from './shared/shared.module';
import {AstronautsService} from './astronauts/astronauts.service';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserAnimationsModule,
    BrowserModule,
    SharedModule,
    FormsModule,
    HttpModule,
    routing
  ],
  providers: [
    AstronautsService
  ],
  bootstrap: [
    AppComponent
  ]
})

export class AppModule {
}

pavel-sindelka avatar Mar 24 '17 16:03 pavel-sindelka

@pavel-sindelka works for me

ctrl-brk avatar Mar 24 '17 17:03 ctrl-brk

@ctrl-brk Yes it works :)

pavel-sindelka avatar Mar 24 '17 17:03 pavel-sindelka

You need to import animations module, please review changelog of Angular, animations have their own module now.

cagataycivici avatar Mar 24 '17 18:03 cagataycivici

In order to support Angular v4 animations you should: Install animations npm install @angular/animations --save Add import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; and import in root NgModule

stirumala76 avatar Mar 28 '17 19:03 stirumala76

Had same issue.. got resolved with import of import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

elmoyeldo avatar Mar 29 '17 18:03 elmoyeldo

I use angular-cli here's how I fixed it

console window

npm install --save @angular/animations@latest

and at the top of app.module.ts

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

and then in the @NgModule part of app.module.ts

@NgModule({
  declarations: [ ... ],
  imports: [
    ...
    BrowserAnimationsModule, \\ <-include this
  ],
  providers: [... ],
  bootstrap: [...]
})

petersgiles avatar Mar 30 '17 00:03 petersgiles

But it is possible to put it into a different module than app.module right?!

I put it into a module keeping ui stuff together so we do not need to import everything, because the app.module grows steadily enough.

import {CommonModule} from "@angular/common";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {DataTableModule} from "primeng/primeng";
import {CheckboxModule} from "primeng/primeng";
import {ButtonModule} from "primeng/primeng";
import {CalendarModule} from "primeng/primeng";
@NgModule({
    imports: [
        CommonModule,
        BrowserAnimationsModule,
        DataTableModule,
        CheckboxModule,
        ButtonModule,
        CalendarModule
    ],
    declarations: [],
    exports: [
        DataTableModule,
        CheckboxModule,
        ButtonModule,
        CalendarModule
    ]
})
export class AppPrimeNGModule { }

and then import this module into app.module...

guntram avatar Mar 31 '17 11:03 guntram

Do not forget to add those lines in systemjs.config.js : '@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js', '@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js', '@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',

Found here : https://github.com/mgechev/angular-seed/issues/1880

tranbenoit avatar Apr 16 '17 00:04 tranbenoit

@mustafaekim work for me thanks .

ahelord avatar May 20 '17 00:05 ahelord

My issue was that this was causing tests to fail. It should be noted that if you are going to use the BrowserAnimationsModule in a component that you have to also have to NgModule import that in your component's spec file.

In my case...

import { TangerineFormCardComponent } from './tangerine-form-card.component';
import { TangerineFormsModule } from '../../tangerine-forms.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

describe('TangerineFormCardComponent', () => {
  let component: TangerineFormCardComponent;
  let fixture: ComponentFixture<TangerineFormCardComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        TangerineFormsModule,
        BrowserAnimationsModule
        ]
    })
    .compileComponents();
  }))

rjcorwin avatar Jul 03 '17 12:07 rjcorwin

@rjsteinert: true. This did solve the issue from my side. Thanks!

bobKasbi avatar Sep 22 '17 12:09 bobKasbi

Here also same issue. But If I run in VS Code, there is no error. I'm getting the error if I run in Visual Studio IDE. Tried to solve all above solutions. But didn't work.. errorinconsole

Project link In VS Code

Project link in Visual Studio IDE

ShaileshBhatNP avatar Feb 06 '18 08:02 ShaileshBhatNP