question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected value 'CKEditorModule' imported by the module 'AppModule'`

See original GitHub issue

Uncaught Error: Unexpected value 'CKEditorModule' imported by the module 'AppModule'

After installing & importing in my app module.

Any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Nandan108commented, Nov 4, 2016

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…

1reaction
LeonardCModorancommented, Oct 25, 2016

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found