kit
kit copied to clipboard
vscode cannot read correctly files
Describe the bug
Reproduction
open last sveltekit2 project in vscode and try to import something
Logs
No response
System Info
macOS, VScode
Severity
blocking an upgrade
Please provide a minimal reproduction in the form of a code repository.
The duplication seems to be because TypeScript 5.3+ fixes some issue path completion for rootDirs
. The path completion now shows the files and directories inside .svelte-kit/types
. But I only see the directory has two entries, and the file doesn't get duplicated. And it also appears in SvelteKit v1. So, there might be another issue with your setup. We'll definitely need a reproduction to check. Also, Can you try disabling all VSCode extensions to see if it's caused by the extension you installed?
The duplication seems to be because TypeScript 5.3+ fixes some issue path completion for
rootDirs
. The path completion now shows the files and directories inside.svelte-kit/types
. But I only see the directory has two entries, and the file doesn't get duplicated. And it also appears in SvelteKit v1. So, there might be another issue with your setup. We'll definitely need a reproduction to check. Also, Can you try disabling all VSCode extensions to see if it's caused by the extension you installed?
disabling extensions provide the same result: https://github.com/ivanafanasyeu/vscode-dub
It seems like the file duplication only happens when there is a directory with an upper case character in the file tree. For example:
/path/To/project/+page.ts
. This is related to SvelteKit because of the rootDirs
configuration, but it is definitely a TypeScript issue. And it also happens in SvelteKit v1, so it certainly isn't "blocking an upgrade".
The next TypeScript release is at least March, but they haven't released the plan yet, So it might be way later. If you're annoyed by it, you can work around it by moving your project to a path with no uppercase directory. At least it'll have less duplication.
It seems like the file duplication only happens when there is a directory with an upper case character in the file tree. For example:
/path/To/project/+page.ts
. This is related to SvelteKit because of therootDirs
configuration, but it is definitely a TypeScript issue. And it also happens in SvelteKit v1, so it certainly isn't "blocking an upgrade".The next TypeScript release is at least March, but they haven't released the plan yet, So it might be way later. If you're annoyed by it, you can work around it by moving your project to a path with no uppercase directory. At least it'll have less duplication.
it's definitely not about the case, it literally something with reading paths at all
Sorry. I don't understand what you meant by "something with reading paths at all". If I understand correctly, Your problem is the auto-completion with the path in the module specifier. And that feature is provided by TypeScript, no matter if it's a ts/js file or a svelte file.
The case I first mentioned where it has two "routes" directories is because of the "rootDirs" config that SvelteKit generated. They're not duplicates, just the same name. The three times duplicate is the previous case plus a TypeScript bug. Some paths are converted to lowercase in case-insensitive file systems, but some are not, so the de-duplicate doesn't work correctly.
If you're not reporting on the auto-completion. Please provide details on what exactly your problem is.
Closing due to inactivity