Devextreme-angular: Unexpected module 'DevExtremeModule' declared by the module 'AppModule'

Created on 22 Sep 2016  路  8Comments  路  Source: DevExpress/devextreme-angular

Most helpful comment

thank you everyone for your answers. I found that this error is my fault,
right code is
@NgModule({
imports: [ DevExtremeModule],
declarations: [
AppComponent
],
bootstrap: [AppComponent]
})
export class AppModule { }
my wrong code is
@NgModule({
imports: [ ],
declarations: [
AppComponent,DevExtremeModule
],
bootstrap: [AppComponent]
})
export class AppModule { }

All 8 comments

This sounds the same as #114

Hello!
We need more information to research the issue. Can you provide an example or a project where we can reproduce the problem?

I reproduced this using angular2-webpack-starter.

  1. git clone https://github.com/AngularClass/angular2-webpack-starter.git
  2. npm install --save devextreme-angular2
  3. Add DevExtremeModule to the imports in AppModule in src/app/app.module.ts
  4. npm run server:dev

There's no AoT compilation happening in this workflow.

One key difference: the error message I reproduced is Unexpected module 'DevExtremeModule' imported by the module 'AppModule'. Note imported, not declared.

I assume that the original poster just mistyped the error message. If it isn't a typo, then the problem is that they're putting DevExtremeModule in the declarations section instead of the imports section.

This happens when you upgrade to angular 2.0.1. The problem goes away if you downgrade back to 2.0.0.

And now, after wiping out node_modules and running npm install again, the problem has disappeared - even on angular 2.0.1. I'll post again if I can reliably reproduce.

Ok. You can ignore my previous comment. I'm not sure what happened. Installing with Angular 2.0.1 reliably reproduces the issue.

thank you everyone for your answers. I found that this error is my fault,
right code is
@NgModule({
imports: [ DevExtremeModule],
declarations: [
AppComponent
],
bootstrap: [AppComponent]
})
export class AppModule { }
my wrong code is
@NgModule({
imports: [ ],
declarations: [
AppComponent,DevExtremeModule
],
bootstrap: [AppComponent]
})
export class AppModule { }

Was this page helpful?
0 / 5 - 0 ratings