-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: “Unexpected value 'undefined' imported by the module 'AppModule'” when importing Angular2 (RC6) module built by webpack #2964
Comments
Can you provide a standalone repo? Thanks! |
Here you are: https://github.com/ogix/ng2-fancy-image-uploader/tree/v1.0.2 |
I am starting to think that webpack in general does not support referencing dependencies that were already built using webpack. Or am I wrong? EDIT: If I specify option: |
see #2945 |
Guys, there is another simple solution for this. I have 2 modules which are somehow deep in the structure using each other. I ran into the same problem with circular dependencies with webpack and angular 2. I simply changed the way of how the one module is declared: ....
@NgModule({
imports: [
CommonModule,
FormsModule,
require('../navigation/navigation.module')
],
declarations: COMPONENTS,
exports: COMPONENTS
})
class DppIncludeModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: DppIncludeModule
};
}
}
export = DppIncludeModule; When I now using the imports statement on ngModule attribute I simply use: @NgModule({
imports: [
CommonModule,
ServicesModule.forRoot(),
NouisliderModule,
FormsModule,
ChartModule,
DppAccordeonModule,
PipesModule,
require('../../../unbranded/include/include.module')
],
.... With this all problems are away. |
Can this somehow tell me WHICH module is causing the circular dependency? |
if you guys don't have it installed try setting up madge , it will help with circular dependencies, |
@Choleriker it probably better you never posted in the first place. You did not explain what you did, dude. |
I'm submitting a bug report
Webpack version:
1.10.x/2.x
Please tell us about your environment:
Windows 10
Current behavior:
I am getting runtime error “Unexpected value 'undefined' imported by the module 'AppModule'” when importing Angular2 (RC6) module built by webpack. If I build using tsc command then there is no error.
my webpack.config.js:
Expected/desired behavior:
No error
The text was updated successfully, but these errors were encountered: