Closed greggmoritz closed 3 months ago
I think I created a similar sample with Vite + React + TS (no yarn pnp), and the issue is not observed. Apart from the IDE errors (they appear in standard Stackblitz setup), the npx tsc
is clear.
https://stackblitz.com/edit/vitejs-vite-cvkmdt?file=src%2FApp.tsx
Could you share a reproducible sample that we could use to debug this faster?
I think I created a similar sample with Vite + React + TS (no yarn pnp), and the issue is not observed. Apart from the IDE errors (they appear in standard Stackblitz setup), the
npx tsc
is clear.https://stackblitz.com/edit/vitejs-vite-cvkmdt?file=src%2FApp.tsx
Could you share a reproducible sample that we could use to debug this faster?
Thanks for your response @Witoso. I'll work on a repro sample.
@greggmoritz I checked second issue with Type 'string' is not assignable to type '`heading${string}`'
, and it looks like definition of editorConfig
variable's type in your integration is automatically inferred by the TS. In the other words, there might be something like this:
const editorConfig = {
heading: { ... }
};
but should be:
const editorConfig: EditorConfig = {
heading: { ... }
};
@greggmoritz I checked second issue with
Type 'string' is not assignable to type '`heading${string}`'
, and it looks like definition ofeditorConfig
variable's type in your integration is automatically inferred by the TS. In the other words, there might be something like this:const editorConfig = { heading: { ... } };
but should be:
const editorConfig: EditorConfig = { heading: { ... } };
Oo, good tip @Mati365. I'll give this a go, thank you!
Following up to say that @Mati365's suggestion to explicitly type the editor configuration solved my issue. Thank you all for your assistance!
Reproduction Steps
CKEditor
React component from@ckeditor/ckeditor5-react@7.0.0
Expected
Continue to build successfully with no code changes
Actual
Typescript build error:
This looks like the type definition has changed (I did not see this documented), so I added a
class: ''
key/value to the "paragraph" model config and rerun the build. Now I seeAll of the heading options model values are
headingN
and the paragraph option should not be matching theHeadingCustomElementOption
type. This is blocking me from upgrading to the latest version ofckeditor5-react
Environment Details