kobalte icon indicating copy to clipboard operation
kobalte copied to clipboard

typescript error TS2693: T only refers to a type, but is being used as a value here.

Open dvirtz opened this issue 1 year ago • 2 comments

Describe the bug getting the abovementioned error when running type check on a project using kobalt

tsc output node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:14:58 - error TS2693: 'DialogCloseButtonCommonProps' only refers to a type, but is being used as a value here.

14 declare const index_DialogCloseButtonCommonProps: typeof DialogCloseButtonCommonProps; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:15:54 - error TS2693: 'DialogCloseButtonOptions' only refers to a type, but is being used as a value here.

15 declare const index_DialogCloseButtonOptions: typeof DialogCloseButtonOptions; ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:16:52 - error TS2693: 'DialogCloseButtonProps' only refers to a type, but is being used as a value here.

16 declare const index_DialogCloseButtonProps: typeof DialogCloseButtonProps; ~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:17:58 - error TS2693: 'DialogCloseButtonRenderProps' only refers to a type, but is being used as a value here.

17 declare const index_DialogCloseButtonRenderProps: typeof DialogCloseButtonRenderProps; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:18:54 - error TS2693: 'DialogContentCommonProps' only refers to a type, but is being used as a value here.

18 declare const index_DialogContentCommonProps: typeof DialogContentCommonProps; ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:19:50 - error TS2693: 'DialogContentOptions' only refers to a type, but is being used as a value here.

19 declare const index_DialogContentOptions: typeof DialogContentOptions; ~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:20:48 - error TS2693: 'DialogContentProps' only refers to a type, but is being used as a value here.

20 declare const index_DialogContentProps: typeof DialogContentProps; ~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:21:54 - error TS2693: 'DialogContentRenderProps' only refers to a type, but is being used as a value here.

21 declare const index_DialogContentRenderProps: typeof DialogContentRenderProps; ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:22:58 - error TS2693: 'DialogDescriptionCommonProps' only refers to a type, but is being used as a value here.

22 declare const index_DialogDescriptionCommonProps: typeof DialogDescriptionCommonProps; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:23:54 - error TS2693: 'DialogDescriptionOptions' only refers to a type, but is being used as a value here.

23 declare const index_DialogDescriptionOptions: typeof DialogDescriptionOptions; ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:24:52 - error TS2693: 'DialogDescriptionProps' only refers to a type, but is being used as a value here.

24 declare const index_DialogDescriptionProps: typeof DialogDescriptionProps; ~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:25:58 - error TS2693: 'DialogDescriptionRenderProps' only refers to a type, but is being used as a value here.

25 declare const index_DialogDescriptionRenderProps: typeof DialogDescriptionRenderProps; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:26:54 - error TS2693: 'DialogOverlayCommonProps' only refers to a type, but is being used as a value here.

26 declare const index_DialogOverlayCommonProps: typeof DialogOverlayCommonProps; ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:27:50 - error TS2693: 'DialogOverlayOptions' only refers to a type, but is being used as a value here.

27 declare const index_DialogOverlayOptions: typeof DialogOverlayOptions; ~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:28:48 - error TS2693: 'DialogOverlayProps' only refers to a type, but is being used as a value here.

28 declare const index_DialogOverlayProps: typeof DialogOverlayProps; ~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:29:54 - error TS2693: 'DialogOverlayRenderProps' only refers to a type, but is being used as a value here.

29 declare const index_DialogOverlayRenderProps: typeof DialogOverlayRenderProps; ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:30:47 - error TS2693: 'DialogPortalProps' only refers to a type, but is being used as a value here.

30 declare const index_DialogPortalProps: typeof DialogPortalProps; ~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:31:47 - error TS2693: 'DialogRootOptions' only refers to a type, but is being used as a value here.

31 declare const index_DialogRootOptions: typeof DialogRootOptions; ~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:32:45 - error TS2693: 'DialogRootProps' only refers to a type, but is being used as a value here.

32 declare const index_DialogRootProps: typeof DialogRootProps; ~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:33:52 - error TS2693: 'DialogTitleCommonProps' only refers to a type, but is being used as a value here.

33 declare const index_DialogTitleCommonProps: typeof DialogTitleCommonProps; ~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:34:48 - error TS2693: 'DialogTitleOptions' only refers to a type, but is being used as a value here.

34 declare const index_DialogTitleOptions: typeof DialogTitleOptions; ~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:35:46 - error TS2693: 'DialogTitleProps' only refers to a type, but is being used as a value here.

35 declare const index_DialogTitleProps: typeof DialogTitleProps; ~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:36:52 - error TS2693: 'DialogTitleRenderProps' only refers to a type, but is being used as a value here.

36 declare const index_DialogTitleRenderProps: typeof DialogTitleRenderProps; ~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:37:54 - error TS2693: 'DialogTriggerCommonProps' only refers to a type, but is being used as a value here.

37 declare const index_DialogTriggerCommonProps: typeof DialogTriggerCommonProps; ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:38:50 - error TS2693: 'DialogTriggerOptions' only refers to a type, but is being used as a value here.

38 declare const index_DialogTriggerOptions: typeof DialogTriggerOptions; ~~~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:39:48 - error TS2693: 'DialogTriggerProps' only refers to a type, but is being used as a value here.

39 declare const index_DialogTriggerProps: typeof DialogTriggerProps; ~~~~~~~~~~~~~~~~~~

node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:40:54 - error TS2693: 'DialogTriggerRenderProps' only refers to a type, but is being used as a value here.

40 declare const index_DialogTriggerRenderProps: typeof DialogTriggerRenderProps; ~~~~~~~~~~~~~~~~~~~~~~~~

Found 27 errors in the same file, starting at: node_modules/@kobalte/core/dist/index-1eb52bda.d.ts:14

To Reproduce https://stackblitz.com/edit/solid-vite-v3trbc

tsconfig.json:

{
  "compilerOptions": {
    "outDir": "scripts",
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "bundler",
    "jsx": "preserve",
    "jsxImportSource": "solid-js"
  }
}

Expected behavior No type errors

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 131

Additional context

dvirtz avatar Nov 30 '24 21:11 dvirtz

I'm running into this too. Did you ever find a solution?

ryb73 avatar Jan 30 '25 22:01 ryb73

I added "skipLibCheck": true to tsconfig.json

dvirtz avatar Jan 30 '25 23:01 dvirtz