plate icon indicating copy to clipboard operation
plate copied to clipboard

Typescript errors in generated declaration files

Open latviancoder opened this issue 3 years ago • 2 comments

Description

Declaration files generated by tsc contain errors. For example:

core/dist/utils/plate/createPlateElementComponent.d.ts(17,120): error TS2304: Cannot find name 'T_1'.

https://unpkg.com/@udecode/[email protected]/dist/utils/plate/createPlateElementComponent.d.ts

link/dist/transforms/unwrapLink.d.ts(11,58): error TS2304: Cannot find name 'V_1'.

https://unpkg.com/@udecode/[email protected]/dist/transforms/unwrapLink.d.ts

Steps

  • Build project
  • Look at outputted d.ts files

Our build step showed a bunch of other TS errors too, but I'm not sure if it's related to the issue above or there is something misconfigured on our side.

media/dist/caption/components/CaptionTextarea.d.ts(4,18): error TS2320: Interface 'CaptionTextareaProps' cannot simultaneously extend types 'TextareaAutosizeProps' and 'AsProps<"textarea">'.
  Named property 'as' of types 'TextareaAutosizeProps' and 'AsProps<"textarea">' are not identical.
media/dist/caption/components/CaptionTextarea.d.ts(4,18): error TS2320: Interface 'CaptionTextareaProps' cannot simultaneously extend types 'TextareaAutosizeProps' and 'RefAttributes<HTMLTextAreaElement>'.
  Named property 'ref' of types 'TextareaAutosizeProps' and 'RefAttributes<HTMLTextAreaElement>' are not identical.
media/dist/media/Media.d.ts(16,61): error TS2304: Cannot find name 'T'.
media/dist/media/Media.d.ts(26,65): error TS2304: Cannot find name 'T'.
table/dist/queries/getTableAbove.d.ts(2,37): error TS2307: Cannot find module '@udecode/plate-core/src/index' or its corresponding type declarations.
ui-button/dist/Button/PlateButton.d.ts(8,46): error TS2307: Cannot find module 'twin.macro' or its corresponding type declarations.
ui-media/dist/ImageElement/ImageElement.styles.d.ts(8,32): error TS2307: Cannot find module 'twin.macro' or its corresponding type declarations.
ui-media/dist/ImageElement/ImageElement.styles.d.ts(9,91): error TS2307: Cannot find module 'twin.macro' or its corresponding type declarations.
ui-media/dist/ImageElement/ImageElement.styles.d.ts(10,92): error TS2307: Cannot find module 'twin.macro' or its corresponding type declarations.
ui-media/dist/ImageElement/ImageElement.styles.d.ts(16,33): error TS2307: Cannot find module 'twin.macro' or its corresponding type declarations.
ui-media/dist/ImageElement/ImageElement.styles.d.ts(17,30): error TS2307: Cannot find module 'twin.macro' or its corresponding type declarations.
ui-toolbar/dist/styles.d.ts(3,106): error TS2307: Cannot find module 'twin.macro' or its corresponding type declarations.
ui-toolbar/dist/styles.d.ts(6,105): error TS2307: Cannot find module 'twin.macro' or its corresponding type declarations.
ui/dist/index.d.ts(13,15): error TS2307: Cannot find module '@udecode/plate-ui-horizontal-rule' or its corresponding type declarations.
zustand/middleware/persist.d.ts(98,57): error TS2344: Type 'Ps' does not satisfy the constraint 'Partial<S>'.

latviancoder avatar Sep 08 '22 11:09 latviancoder

Do you have an idea how I can reproduce it in this repo?

zbeyens avatar Sep 08 '22 12:09 zbeyens

You could try experimenting with skipLibCheck tsc option. I've not tried it myself though.

latviancoder avatar Sep 08 '22 14:09 latviancoder

@latviancoder any updates for this issue ?

HaykSim1 avatar Nov 09 '22 10:11 HaykSim1

We dropped the project unfortunately.

latviancoder avatar Feb 18 '23 19:02 latviancoder

Looks to be fixed in v22 https://github.com/udecode/plate/pull/2472, I'll reopen otherwise.

zbeyens avatar Jul 07 '23 15:07 zbeyens