Vscode - Cannot find module './App.svelte' or its corresponding type declarations.
See original GitHub issueDescribe the bug
When the extension installed after scaffolding a project if I open main.js, vs code complains about the error even though everything is perfectly working and valid.
Reproduction
npm init vite my-app -- --template svelte
cd my-app
npm install
npm run dev
And open VS Code.
Expected behaviour
Should not complain
System Info
Windows 10 VS Code: 1.69.0 Svelte for VS Code v105.18.1
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
Issue Analytics
- State:
- Created a year ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
19 - Stack Overflow
Plugin typescript: @rollup/plugin-typescript TS2307: Cannot find module './App.svelte' or its corresponding type declarations. Here's my package ...
Read more >r/sveltejs - Reddit
Cannot find module './App.svelte'. I'm using JavaScript (not TS) and also have the Svelte VS Code extension installed.
Read more >cannot find module or its corresponding type declarations
To solve the "Cannot find module `fs` or its corresponding type declarations" error, install the types for node by running the command `npm...
Read more >1 - Code Grepper
(!) Plugin typescript: @rollup/plugin-typescript TS2307: Cannot find module './App.svelte' or its corresponding type declarations. src/main ...
Read more >TypeScript support in Svelte - Learn web development
Just take into account that the Svelte community is constantly improving ... type checking in vs code - App object has been given...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Experienced the same with a fresh install with Svelte (Typescript) via Yarn 2. Adding this in
svelte.config.js
fixed the issue temporarily, but doing changes in files outlines errors again:The installation was fresh, so this is still a bug and not fixed.
Ah right. that’s the problem. We indeed didn’t check the config in the “remove the ambient type definitions” logic. Ironically what I said you can try is the actual reproduction of the problem. Sorry I didn’t check it more.