yabab-dev / ng2-ckeditor

Angular2 CKEditor component
MIT License
358 stars 96 forks source link

Cannot find type definition file for 'ckeditor'. & Cannot find namespace 'CKEDITOR'. #311

Closed akram1905 closed 3 years ago

akram1905 commented 3 years ago

I started getting those errors after updating from 1.3.1 to 1.3.2 Of course everything was working in 1.3.1

Error: node_modules/ng2-ckeditor/ckeditor.component.d.ts:1:23 - error TS2688: Cannot find type definition file for 'ckeditor'.

1 /// <reference types="ckeditor" />
                        ~~~~~~~~

Error: node_modules/ng2-ckeditor/ckeditor.component.d.ts:13:13 - error TS2503: Cannot find namespace 'CKEDITOR'.

13     config: CKEDITOR.config;
               ~~~~~~~~

Error: node_modules/ng2-ckeditor/ckeditor.component.d.ts:16:26 - error TS2503: Cannot find namespace 'CKEDITOR'.

16     change: EventEmitter<CKEDITOR.eventInfo>;
                            ~~~~~~~~

Error: node_modules/ng2-ckeditor/ckeditor.component.d.ts:17:32 - error TS2503: Cannot find namespace 'CKEDITOR'.

17     editorChange: EventEmitter<CKEDITOR.eventInfo>;
                                  ~~~~~~~~

Error: node_modules/ng2-ckeditor/ckeditor.component.d.ts:18:25 - error TS2503: Cannot find namespace 'CKEDITOR'.

18     ready: EventEmitter<CKEDITOR.eventInfo>;
                           ~~~~~~~~

Error: node_modules/ng2-ckeditor/ckeditor.component.d.ts:19:24 - error TS2503: Cannot find namespace 'CKEDITOR'.

19     blur: EventEmitter<CKEDITOR.eventInfo>;
                          ~~~~~~~~

Error: node_modules/ng2-ckeditor/ckeditor.component.d.ts:20:25 - error TS2503: Cannot find namespace 'CKEDITOR'.

20     focus: EventEmitter<CKEDITOR.eventInfo>;
                           ~~~~~~~~
kzimny commented 3 years ago

The error occures because ng2-ckeditor component reference @types/ckeditor package which need to be installed in your own project. Unfortunatelly the peerDependencies where not updated in release 1.3.2. Add the @types/ckeditor to your dependencies and your project will compile without errors. From now you can use intellisense for ckeditor in your own project components and reference ckeditor not as any but as CKEditorComponent. Have fun! image

Kritika7 commented 3 years ago

where to add this code?

kzimny commented 3 years ago

Please see the installation instruction: https://github.com/chymz/ng2-ckeditor#installation

Kritika7 commented 3 years ago

Hey kzimny, thanks for the above link. I need one more help, do you have any idea regarding functionmatcher error Error: node_modules/@types/jasmine/index.d.ts:668:15 - error TS2430: Interface 'FunctionMatchers' incorrectly extends interface 'Matchers'. The types returned by 'toHaveBeenCalledWith(...)' are incompatible between these types. Type 'boolean' is not assignable to type 'Promise'.

668 interface FunctionMatchers extends Matchers {

kzimny commented 3 years ago

This issue seems to solved your problem already https://github.com/angular/protractor/issues/4521

Kritika7 commented 3 years ago

This issue seems to solved your problem already angular/protractor#4521

it came again