Skip to content
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 snapshot was not found after trying to load script snapshot #2602

Open
datstarkey opened this issue Nov 21, 2024 · 0 comments
Open

Svelte snapshot was not found after trying to load script snapshot #2602

datstarkey opened this issue Nov 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@datstarkey
Copy link

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."

image

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

@datstarkey datstarkey added the bug Something isn't working label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant