-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Svelte types not automatically inferred in .ts
& .js
files
#4577
Comments
.ts
files.ts
& .js
files
Duplicate of #4598 |
@mikayla-maki I don't think this is a duplicate, unless you mean they have the same root cause. That issue seems to be about types not updating when importing in |
Fair point, I misread. |
I am experiencing the same issues as @probablykasper ![]() |
This fixed issues for me Zed Documentation TypeScript |
Installing https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage Would be nice if this wasn't needed though. |
@joshiain - any further info on how you set this up? I've installed
|
Figured out why installing the plugin wasn't helping things. The change in Zed I swapped back to using
I have a hunch that vtsls might be trying to resolve the |
This comment has been minimized.
This comment has been minimized.
To anyone unclear, until this is fixed, a temporary work around is to go to your And inside of "plugins": [{
"name": "typescript-svelte-plugin",
"enabled": true,
"assumeIsSvelteProject": false
}] Run And your SvelteKit types should start working (you may need to reload the extensions/restart the language servers) |
Context
Questions
|
Hi there! 👋 |
Still reproducible in 0.170.4 |
Same here, and the workarounds mentioned above do not work for me. Changing the language server to |
Check for existing issues
Describe the bug / provide steps to reproduce it
In SvelteKit projects, types are automatically inferred for many
export
ed values (Zero-effort type safety).In
![image](https://private-user-images.githubusercontent.com/11315492/256936875-cb34705f-9d76-4bcb-be5c-df037edcd4d5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDQwMDAsIm5iZiI6MTczOTYwMzcwMCwicGF0aCI6Ii8xMTMxNTQ5Mi8yNTY5MzY4NzUtY2IzNDcwNWYtOWQ3Ni00YmNiLWJlNWMtZGYwMzdlZGNkNGQ1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA3MTUwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIyZTMzODNmYmY4NWZmY2VmMDk1OGQyM2FlMDMwNDYwZDRiZGYzNjRhODY2OGIxZDk2YWEwYzhlMGY3OGQzZjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.jEZntatmRKVdf9Z-KXlwvCWfIZn-ND80fwthVCmNUsM)
+page.svelte
, it works:But in
![image](https://private-user-images.githubusercontent.com/11315492/256937232-d3cdda3f-1943-49d9-b7bc-88de82893c11.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDQwMDAsIm5iZiI6MTczOTYwMzcwMCwicGF0aCI6Ii8xMTMxNTQ5Mi8yNTY5MzcyMzItZDNjZGRhM2YtMTk0My00OWQ5LWI3YmMtODhkZTgyODkzYzExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA3MTUwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgxMjJlZGYwMDU3ZWMyMzcyOWU5MTg5Yjk2NGEyYzhhMmU0NTZjMTcwZGVmYTMxODdiOTBiNzRkYjA2ODlkOTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.4IAiyvHe79xOG8fyP03lAcoYvjqp0PzR8owNxEoo8K8)
.ts
/.js
files it does not:Reproduce
npm create svelte@latest
src/routes/sverdle/+page.server.ts
(or.js
)Environment
Zed: v0.96.3 (stable)
OS: macOS 13.5.0
Memory: 32 GiB
Architecture: x86_64
The text was updated successfully, but these errors were encountered: