sander
sander
DDeno
Created by hmt on 5/5/2024 in #help
SvelteKit: Unable to load a local module for './$types'
@bondsandbarrels ah nice! ❤️ didn't know about that 😃
8 replies
DDeno
Created by hmt on 5/5/2024 in #help
SvelteKit: Unable to load a local module for './$types'
The problem is that Deno at the moment doesn't support the rootDirs option that SvelteKit uses to resolve these generated files. See this issue: https://github.com/denoland/deno/issues/26871 My workaround for now is to not enable VSCode/Deno in the SvelteKit project itself and embed the Deno TypeScript definitions directly in the project:
cd src
curl -s -O https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/tsc/dts/lib.deno.ns.d.ts
curl -s -O https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/tsc/dts/lib.deno.unstable.d.ts
# remove this line from the *.d.ts files:
# /// <reference no-default-lib="true" />
cd src
curl -s -O https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/tsc/dts/lib.deno.ns.d.ts
curl -s -O https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/tsc/dts/lib.deno.unstable.d.ts
# remove this line from the *.d.ts files:
# /// <reference no-default-lib="true" />
Not sure if there are better ways to work around the current limitation.
8 replies