Open madeleineostoja opened 1 year ago
I have snippets that I reuse in my queries, which I import from a file. That file import is aliased, configured both in Typescript and Vite (used in a Sveltekit app), but the client tries to resolve these imports and fails.
Eg:
import { groq, sanity } from '$src/lib/sanity'; import { asset } from '$src/lib/fragments'; sanity('Foo', groq` * { image { ${asset} } `)
Resulting error:
[default] Generating types for workspace `default` Error: Cannot find module '$src/lib/fragments'
Rewriting the asset snippet import to not use an alias fixes the error, but is an annoying workaround
EDIT: This is kinda redundant if this issue can't be resolved: #290
I have snippets that I reuse in my queries, which I import from a file. That file import is aliased, configured both in Typescript and Vite (used in a Sveltekit app), but the client tries to resolve these imports and fails.
Eg:
Resulting error:
Rewriting the asset snippet import to not use an alias fixes the error, but is an annoying workaround
EDIT: This is kinda redundant if this issue can't be resolved: #290