Skip to content
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

Build error: All declarations of 'CKEDITOR_VERSION' must have identical modifiers. #342

Closed
tahaerden opened this issue Dec 19, 2022 · 4 comments · Fixed by #350
Closed
Assignees
Labels
pending:feedback This issue is blocked by necessary feedback. squad:devops Issue to be handled by the Devops team. type:question
Milestone

Comments

@tahaerden
Copy link

I have just installed and set up ckeditor5-angular following the Getting Started guide. And I am facing the errors below on build:


Error: node_modules/@ckeditor/ckeditor5-angular/ckeditor.component.d.ts:8:9 - error TS2687: All declarations of 'CKEDITOR_VERSION' must have identical modifiers.

8         CKEDITOR_VERSION?: string;
          ~~~~~~~~~~~~~~~~


Error: node_modules/@ckeditor/ckeditor5-angular/ckeditor.component.d.ts:8:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'CKEDITOR_VERSION' must be of type '"32.0.0"', but here has type 'string | undefined'.

8         CKEDITOR_VERSION?: string;
          ~~~~~~~~~~~~~~~~

  node_modules/@types/ckeditor__ckeditor5-utils/src/version.d.ts:5:9
    5         CKEDITOR_VERSION: typeof version;
              ~~~~~~~~~~~~~~~~
    'CKEDITOR_VERSION' was also declared here.


Error: node_modules/@types/ckeditor__ckeditor5-utils/src/version.d.ts:5:9 - error TS2687: All declarations of 'CKEDITOR_VERSION' must have identical modifiers.

5         CKEDITOR_VERSION: typeof version;

My versions are:

"@angular/animations": "~13.3.11",
"@angular/cdk": "^13.3.9",
"@angular/common": "~13.3.11",
"@angular/compiler": "~13.3.11",
"@angular/core": "~13.3.11",
"@angular/forms": "~13.3.11",
"@angular/material": "^13.3.9",
"@angular/material-moment-adapter": "^13.3.9",
"@angular/platform-browser": "~13.3.11",
"@angular/platform-browser-dynamic": "~13.3.11",
"@angular/router": "~13.3.11",
"@ckeditor/ckeditor5-angular": "^4.0.0",
"@ckeditor/ckeditor5-build-classic": "^35.4.0",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"

Temporary fix that works:

  • Go to file \node_modules@ckeditor\ckeditor5-angular\ckeditor.component.d.ts
  • Comment out CKEDITOR_VERSION?: string; on line 8.
@FilipTokarski
Copy link
Member

We checked the guide on integration with Angular and had no problems with running the editor.

Are you able to provide detailed steps to reproduce this problem?

@FilipTokarski FilipTokarski added pending:feedback This issue is blocked by necessary feedback. type:question labels Dec 19, 2022
@tahaerden
Copy link
Author

tahaerden commented Dec 19, 2022

What I basically did step by step is:

  1. npm install --save @ckeditor/ckeditor5-angular
  2. npm install --save @ckeditor/ckeditor5-build-classic
  3. Added CKEditorModule to my module
  4. Added public Editor = ClassicEditor; and its import to TS.
  5. Added <ckeditor...> to HTML.
  6. Added const ClassicEditorBuild: any; to typings.d.ts.

And faced the error on npm start. Maybe it's a specific bug in the Angular and Ckeditor versions that I use.

Here you can see someone else had the exact same issue, and I used the best answer for a temporary fix.

@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Feb 9, 2023
@psmyrek psmyrek self-assigned this Feb 9, 2023
@psmyrek psmyrek added the squad:devops Issue to be handled by the Devops team. label Feb 9, 2023
@pomek pomek closed this as completed in #350 Feb 9, 2023
pomek added a commit that referenced this issue Feb 9, 2023
Fix: Aligned `window.CKEDITOR_VERSION` type with the community typings. Closes #342.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Feb 9, 2023
@CKEditorBot CKEditorBot added this to the iteration 61 milestone Feb 9, 2023
@pomek
Copy link
Member

pomek commented Feb 9, 2023

The issue has been addressed. Could you check the latest release? 👉 https://github.com/ckeditor/ckeditor5-angular/releases/tag/v5.1.0

@tahaerden
Copy link
Author

@pomek The issue seems to be fixed in my case. Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending:feedback This issue is blocked by necessary feedback. squad:devops Issue to be handled by the Devops team. type:question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants