Alberplz / angular2-color-picker

Angular 2 Color Picker Directive, no dependences required.
MIT License
185 stars 82 forks source link

no NgModule metadata found for 'DynamicCpModule' #61

Open mmikeyy opened 7 years ago

mmikeyy commented 7 years ago

The component wasn't working at all when imported from node_modules. So I took the typescript sources and put them in their own directory amid the rest of my sources. Then all was well.

... until I generated the production build (using webpack). On the dev server, everything works fine. But on the production build, the only single thing that does not work is this colorpicker component.

The dialog just won't open. Instead, I get this error:

app.dd5b3c0….js:88596 Error: No NgModule metadata found for 'DynamicCpModule'. at NgModuleResolver.resolve (app.dd5b3c0….js:67790) at CompileMetadataResolver.getNgModuleMetadata (app.dd5b3c0….js:66867) at RuntimeCompiler._compileComponents (app.dd5b3c0….js:84200) at RuntimeCompiler._compileModuleAndAllComponents (app.dd5b3c0….js:84144) at RuntimeCompiler.compileModuleAndAllComponentsAsync (app.dd5b3c0….js:84135) at ModuleBoundCompiler.compileModuleAndAllComponentsAsync (app.dd5b3c0….js:84453) at ColorPickerDirective.exports.ColorPickerDirective.ColorPickerDirective.openDialog (app.dd5b3c0….js:99029) at ColorPickerDirective.exports.ColorPickerDirective.ColorPickerDirective.onClick (app.dd5b3c0….js:99022) at _View_ColorInterfaceComponent0._handle_click_5_2 (ColorInterfaceComponent.ngfactory.js:292) app.dd5b3c0….js:88596 Error: No NgModule metadata found for 'DynamicCpModule'. at NgModuleResolver.resolve (app.dd5b3c0….js:67790) at CompileMetadataResolver.getNgModuleMetadata (app.dd5b3c0….js:66867) at RuntimeCompiler._compileComponents (app.dd5b3c0….js:84200) at RuntimeCompiler._compileModuleAndAllComponents (app.dd5b3c0….js:84144) at RuntimeCompiler.compileModuleAndAllComponentsAsync (app.dd5b3c0….js:84135) at ModuleBoundCompiler.compileModuleAndAllComponentsAsync (app.dd5b3c0….js:84453) at ColorPickerDirective.exports.ColorPickerDirective.ColorPickerDirective.openDialog (app.dd5b3c0….js:99029) at ColorPickerDirective.exports.ColorPickerDirective.ColorPickerDirective.onClick (app.dd5b3c0….js:99022) at _View_ColorInterfaceComponent0._handle_click_5_2 (ColorInterfaceComponent.ngfactory.js:292)

Can anyone tell me what I should do? As previously mentioned, all is well with the dev build, so it does not seem to have anything to do with how I'm using the component...