DenoDDeno
Powered by
roufpupR
Denoβ€’14mo agoβ€’
7 replies
roufpup

[Svelte + Vite + Deno 2.0] Svelte and Vite configuration without a package.json

Hello, i am trying to setup a deno 2.0 simple project that has svelte (not svelte kit) and vite on it as well as rely only on a deno.json file for the dependency installation instead of package.json.
My current situation is, i have the project setup with the needed dependencies inside of the deno.json and i have the vite.config.ts, svelte.config.ts and tsconfig.json setup as well. Initially the project works just fine when you run it with just
vite
vite
, but when i try to add a Svelte component like the usual App.svelte i am being hit with this vite error
Pre-transform error: Failed to resolve import "svelte/internal/disclose-version" from "src/App.svelte". Does the file exist?
Pre-transform error: Failed to resolve import "svelte/internal/disclose-version" from "src/App.svelte". Does the file exist?
. I am pretty sure that the root cause for this is the fact that the modules with deno 2.0 and deno.json are being installed in a diffrent directory for me on Linux that's
.cache/deno
.cache/deno
, the file mentioned in the vite error is present in the svelte module folder that is in
.cache/deno/npm/registry.npmjs.org/svelte/5.15.0/src/internal/
.cache/deno/npm/registry.npmjs.org/svelte/5.15.0/src/internal/
. I am not sure what i am supposed to do to make vite look into that path to fetch the file it needs. Thanks in advance for any responses
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

πŸ¦• Deno adds to package.json instead of deno.jsonc.
RolloRRollo / help
5mo ago
is there a deno-fresh compatible json rpc 2.0 websocket package?
datmetal1Ddatmetal1 / help
2y ago
Converting package.json into deno.json
KotkoroidKKotkoroid / help
15mo ago
Configure a deno.json to disregard package.json?
danthemanDdantheman / help
7mo ago