Svelte errors with adapter-cloudflare

Here's the error I get when running bun run build:
> Using @sveltejs/adapter-cloudflare
✘ [ERROR] Could not resolve "../../../chunks/app2.js"

.svelte-kit/output/server/entries/endpoints/test/_server.ts.js:4:21:
4 │ css = await import("../../../chunks/app2.js");
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~
> Using @sveltejs/adapter-cloudflare
✘ [ERROR] Could not resolve "../../../chunks/app2.js"

.svelte-kit/output/server/entries/endpoints/test/_server.ts.js:4:21:
4 │ css = await import("../../../chunks/app2.js");
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~
5 Replies
jason
jason15mo ago
FWIW, I wouldn't worry about using bun run build yet, your command is actually using NodeJS to execute vite build unless you run it as bun run --bun vite build which will encounter errors. In other words, I'd stick with npm run build for now. It's likely you'll encounter the same error though, but you'll know it's not bun related. The benefit of bun on Cloudflare Pages right now imo, comes from committing bun.lockb so that Cloudflare Pages automatically uses bun install --frozen-lockfile during your build.
GetPsyched
GetPsychedOP15mo ago
Hmm, fair enough The error persists though.
jason
jason15mo ago
Yeah, but now you know it's project related. 🙂 Try to simplify to narrow it down or ask in Svelte's discord. I'd recommend deleting .svelte-kit and node_modules to guarantee, and run bun install and build again just to be sure it's code related.
GetPsyched
GetPsychedOP15mo ago
yeah I think I figured it out the actual error was something else that was being masked by this
jason
jason15mo ago
cool
Want results from more Discord servers?
Add your server