You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript is complaining that svelte doesn't export ComponentType, which looks to be true when I inspect the index.d.ts file from Svelte. However I don't see this mentioned in the migration notes, and #8512 even details that you should use ComponentType in v4 to type components.
Have I misunderstood something? I tried poking around in the version-4 branch, and couldn't find any ComponentType export either, but I admit that I could easily be missing it.
This is a basic template created with npm create vite, installing svelte@next afterwards, and only modifying src/main.ts to reproduce the bug.
npm install
npm run check
See that importing ComponentType from "svelte/types/runtime/internal" is okay, but not directly from "svelte".
Logs
npm run check
> svelte-v4-repro@0.0.0 check
> svelte-check --tsconfig ./tsconfig.json
====================================
Loading svelte-check in workspace: /Users/jeppe/dev/temp/svelte-v4-repro
Getting Svelte diagnostics...
/Users/jeppe/dev/temp/svelte-v4-repro/src/main.ts:5:15
Error: Module '"svelte"' has no exported member 'ComponentType'.
import type { ComponentType as InternalComponentType } from "svelte/types/runtime/internal";
import type { ComponentType } from "svelte";
====================================
svelte-check found 1 error and 0 warnings in 1 file
Describe the bug
TypeScript is complaining that
svelte
doesn't exportComponentType
, which looks to be true when I inspect theindex.d.ts
file from Svelte. However I don't see this mentioned in the migration notes, and #8512 even details that you should useComponentType
in v4 to type components.Have I misunderstood something? I tried poking around in the
version-4
branch, and couldn't find anyComponentType
export either, but I admit that I could easily be missing it.Script in Svelte v3 source adding the ComponentType export: https://github.com/sveltejs/svelte/blob/master/generate-type-definitions.js
Reproduction
https://github.com/JReinhold/svelte-8692-reproduction
This is a basic template created with
npm create vite
, installingsvelte@next
afterwards, and only modifyingsrc/main.ts
to reproduce the bug.npm install
npm run check
See that importing
ComponentType
from"svelte/types/runtime/internal"
is okay, but not directly from"svelte"
.Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: