ckeditor / ckeditor5-angular

Official CKEditor 5 Angular 5+ component.
https://ckeditor.com/ckeditor-5
Other
202 stars 110 forks source link

TS2411: Property '[FONT_SIZE]' of type 'FontSizeCommand' is not assignable to 'string' index type 'Command' #404

Open sergey-morenets opened 7 months ago

sergey-morenets commented 7 months ago

Hi

We have Angular project with Ckeditor 5 dependency. Everything was working fine if we used the following versions:

    "@ckeditor/ckeditor5-angular": "^7.0.1",
    "@ckeditor/ckeditor5-core": "^40.2.0"

Once we upgraded "@ckeditor/ckeditor5-core" (and related Ckeditor dependencies) to 41.0.0 we got multiple errors during build, for example:

X [ERROR] TS2411: Property '[FONT_SIZE]' of type 'FontSizeCommand' is not assignable to 'string' index type 'Command'. [plugin angular-compiler]

    node_modules/@ckeditor/ckeditor5-font/src/augmentation.d.ts:53:8:
      53 │         [FONT_SIZE]: FontSizeCommand;

Angular: 17.1.0.

Witoso commented 7 months ago

Hi! Could you provide more details about your setup? I checked quickly that the online builder folder next to the Angular's src still works with the version v41. Two things happened in v41, we resolved an issue with ESM in our packages, and bumped TS to 5.0.0.

sergey-morenets commented 7 months ago

Hi! Could you provide more details about your setup? I checked quickly that the online builder folder next to the Angular's src still works with the version v41. Two things happened in v41, we resolved an issue with ESM in our packages, and bumped TS to 5.0.0.

Hi @Witoso

Which information do you need? We use custom CkEditor build and the following dependencies now:

    "@ckeditor/ckeditor5-angular": "^7.0.1",
    "@ckeditor/ckeditor5-core": "^40.2.0",
    "@ckeditor/ckeditor5-engine": "^40.2.0",
    "@ckeditor/ckeditor5-utils": "^40.2.0",
    "@ckeditor/ckeditor5-watchdog": "^40.2.0",
    "ckeditor5-custom-build": "file:ckeditor",
Witoso commented 7 months ago

Once we upgraded "@ckeditor/ckeditor5-core" (and related Ckeditor dependencies) to 41.0.0 we got multiple errors during build, for example:

What do you mean by build here? Is it a build command run in the ckeditor folder?

sergey-morenets commented 7 months ago

No, it's our application build: ng build.

Witoso commented 7 months ago

I don't see the @ckeditor/ckeditor5-font on the list of the deps you listed, how did it get there?

sergey-morenets commented 7 months ago

Not sure. I'm not an expert in CKEditor

Witoso commented 7 months ago

I cannot reproduce this error. Tried on StackBlitz, and everything works.

Unfortunately, without understanding of how your project is set up, it will be difficult to debug this.

KevinMarques commented 7 months ago

Same issue here, not only with FontSizeCommand but also with many other Commands:

... node_modules/@ckeditor/ckeditor5-table/src/augmentation.d.ts Property 'tableWidth' of type 'TableWidthCommand' is not assignable to 'string' index type 'Command'. ...

I think the problem is not specific to CKEditor v41.0.0 but to Angular 17.1

Witoso commented 7 months ago

We cannot reproduce with v16 and v17, could you provide some minimal samples?

benzara-tahar commented 7 months ago

I had similar issue after updating to angular 17.1.3, adding "skipLibCheck": true, to tsconfig.json fixed it for me.