Unexpected value 'CKEditorModule' imported by the module 'AppModule'`
See original GitHub issueUncaught Error: Unexpected value 'CKEditorModule' imported by the module 'AppModule'
After installing & importing in my app module.
Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Unexpected value ' ' imported by the module ' '. Please add a ...
The problem is when I try to compile the code I get this error: Unexpected value 'HttpClient' imported by the module 'AppModule'.
Read more >Error: Unexpected value 'undefined' imported by the module
I'm getting this error after migrating to NgModule, the error doesn't help too much, any advice please? Error: Error: Unexpected value 'undefined' imported...
Read more >Unexpected value 'CKEditorModule' imported by the module ...
Uncaught Error : Unexpected value 'CKEditorModule' imported by the module 'AppModule'. After installing & importing in my app module.
Read more >Untitled
This package contains the CKEditor module that will enable theCKEditor ... serve' Unexpected value 'MDCTextField' imported by the module 'AppModule'. minor ...
Read more >ng2-ckeditor - npm
Include CKEditorModule in your main module : import { CKEditorModule } from 'ng2-ckeditor'; import ... export class AppModule {}.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! I tracked down the error to it’s point of origin, in
webpack:///./~/@angular/core/bundles/compiler.umd.js:14038
.The compiler verifies that each module is truly a module by checking that the object provided has a metadata object that is an instance of DecoratorFactory as defined in
webpack:///./~/@angular/core/bundles/core.umd.js.
The problem happens when the CKEditorModule’s metadata object is instead an instance of DecoratorFactory as defined in another file:
webpack:///./~/ng2-ckeditor/~/@angular/core/bundles/core.umd.js
.In short, the issue arises from CKEditorModule using its own, separate copy of angular core, when loaded via WebPack. This explains why LeonardCModoran’s workaround worked: copying the Ng2CKEditor code into his project ensured that it used the same angular core as the rest of his code.
That’s as far as I’ll go unfortunately. I haven’t studied how to develop and publish shareable components or libraries in Ng2, so I haven’t got a clue how to fix this. Hopefully someone can take it from there?
Update: In the end, deleting the node_modules sub-folder was the only thing needed to get it working.
rm -R node_modules/ng2-ckeditor/node_modules/
Now how the heck did I end up with a node_modules subdir in there? I just deleted the whole ng2-ckeditor folder and re-ran npm install. Now it’s back, but clean of any unneeded stuff. And it works out of the box. Oh well…Having the same error, when using Webpack. With SystemJS everything is working fine.
Later: Had to fix this issue, and what I did is copy the module and the component from the src file inside my project, then done some small edits (had some highlighting issues like @Input() config: any;) and then imported from the global scope CKEDITOR using: declare const CKEDITOR: any; Last step was to import the module from the new location and the error has gone…
my guess is how has been exported eg: export * from ‘…’ and maybe should have been export {CKEditorComponent} from ‘…’ as per eg: https://github.com/angular/angular-cli/issues/1831#issuecomment-244874596