-
-
Notifications
You must be signed in to change notification settings - Fork 212
Description
Describe the bug
Issue
Depending on the order of typescript files opened in a monorepo, the typescript server becomes unable to resolve svelte file snapshots stating:
-Svelte Plugin- Svelte snapshot was not found after trying to load script snapshot for
The IDE shows:
Cannot find module './MyComponent.svelte' or its corresponding type declarations."
This eventually breaks intelisense within the monorepo and cannot be fixed without entirely restarting vscode. restarting the TS server/Svelte server/Host extensions doesn't seem to fix anything.
Reproduction
Repo https://github.com/datstarkey/svelte-snapshot-failure
Replication
To replicate, install the project in the root with pnpm i
Enable TS server Logging
Navigate to shared/src/lib/index.ts
in your IDE
Everything looks okay
Navigate to web/src/lib/index.ts
in your IDE
Everything looks okay
Leave web/src/lib/index.ts
open and close vscode
Reopen vscode at web/src/lib/index.ts
Everything looks okay
Navigate to shared/src/lib/index.ts
Error: Cannot find module './MyComponent.svelte' or its corresponding type declarations.ts(2307)
TS Server Log Error:
info 55 [14:57:24.357] -Svelte Plugin- Svelte snapshot was not found after trying to load script snapshot for /Users/jake/Repos/svelte-snapshot-failure/shared/src/lib/MyComponent.svelte
Only way to fix is to restart VScode
Differences
I've tried this with and without project references, path alias's and installing the project as pnpm workspace package, and it always gives the same error
Expected behaviour
A monorepo project should work regardless of which project is opened first.
System Info
- OS: Mac & windows
- IDE: vscode
Which package is the issue about?
No response
Additional Information, eg. Screenshots
No response