-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] private ComponentType
interface breaks type declarations
#14256
Comments
What is the reason for using |
This is for a library of web components, so svelte has to be compiled to JavaScript in the build step. |
I'm wondering if that is of much use, since TS doesn't know anything about the shape of the components - is that a non-problem in your case? |
Yeah, that's a non-problem in our case. |
Describe the bug
When using tsc to emit types for a svelte 5 project with
"declarations": true
set in thetsconfig.json
, the compilation fails with an error:error TS4082: Default export of the module has or is using private name 'ComponentType'.
(Interestingly, the problem only seems to occur, when a component is passed "through" a generic function, in case of the reproduction:
doSth
)Reproduction
https://stackblitz.com/edit/vitejs-vite-fgmgkx?file=src%2Findex.ts
run
npx tsc
to see how the compilation fails.Potential fix:
if we go to
node_modules/svelte/types/index.d.ts
line2315
however, and modify it to export the interface, the compilation finishes without error.Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: