-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
Error: "Debug Failure. File ... has unknown extension" #1187
Comments
We might need a reproducible for this one. The error is thrown by typescript as shown in the error stack. Typescript's codebase is very complex. Without a reproducible, it's really hard to track down the problem. |
I guess I have found a reproducible. Can you check if you have the |
It's also possible that the "typescript.preferences.importModuleSpecifierEnding" config is set to Guess it would be better we file an issue on the typescript repo to ask if they can remove this debug assertion or not. This might also happen in a lot of tooling for component frameworks with a custom file extension. I tried and it also appears in vetur (for vue). So it might be more beneficial to "fix" on the typescript side. |
If the module specified ending is the problem - this might get much more pressing soon, when TS 4.5 is released which brings a ESM mode where module specifier endings are mandatory. |
…1242) Related to #1187 TypeScript throws a debug assertion error if the importModuleSpecifierEnding config is 'js' and there's an unknown file extension (like '.svelte'). Although it's probably better to fix this on the TypeScript side, that it would probably take a while. So this is a workaround for now. Not all cases are fixed, but at least it's less likely to happen.
Describe the bug
Suddenly, after working for a while, Svelte for VS Code stops working. It will still give me options for auto-importing files, but there is no path included in the options and selecting an option doesn't add any imports to the file being edited.
The error shown in the output tab says:
Error: Debug Failure. File ../components/LanguageSelectButton.svelte has unknown extension.
Not sure what the error actually means, but pretty sure the file has a known extension,
.svelte
.The output tab content for Svelte
Using Svelte v3.43.0 from /Users/arggh/Develop/example/example-foo/node_modules/svelte/compiler
Error: Debug Failure. File ../../../../../packages/example-ui/src/LanguageSelect/LanguageSelect.svelte has unknown extension.
at Object.extensionFromPath (/Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:20405:51)
at getJSExtensionForFile (/Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:117454:136)
at removeExtensionAndIndexPostFix (/Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:117447:42)
at getLocalModuleSpecifier (/Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:117000:17)
at computeModuleSpecifiers (/Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:116967:33)
at Object.getModuleSpecifiersWithCacheInfo (/Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:116927:26)
at getModuleSpecifiers (/Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:146057:72)
at /Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:146060:26
at Object.flatMap (/Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:713:25)
at getNewImportFixes (/Users/arggh/.vscode-insiders/extensions/svelte.svelte-vscode-105.4.0/node_modules/typescript/lib/typescript.js:146059:28)
Using Svelte v3.43.0 from /Users/arggh/Develop/example/node_modules/svelte/compiler
SnapshotManager File Statistics:
Project files: 0
Svelte files: 204
From node_modules: 309
Total: 729
Using Svelte v3.43.0 from /Users/arggh/Develop/example/node_modules/svelte/compiler
Screenshots
System (please complete the following information):
The text was updated successfully, but these errors were encountered: