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

bun build --compile doesn't work for sveltekit apps #15734

Open
opensas opened this issue Dec 12, 2024 · 0 comments
Open

bun build --compile doesn't work for sveltekit apps #15734

opensas opened this issue Dec 12, 2024 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@opensas
Copy link

opensas commented Dec 12, 2024

What version of Bun is running?

1.1.38

What platform is your computer?

Linux 6.8.0-49-generic x86_64 x86_64

What steps can reproduce the bug?

reference docs:

$ bunx sv create sveltekit-bun-app

┌  Welcome to the Svelte CLI! (v0.6.7)
│
◇  Which template would you like?
│  SvelteKit demo
│
◇  Add type checking with Typescript?
│  Yes, using Typescript syntax
│
◆  Project created
│
◇  What would you like to add to your project? (use arrow keys / space bar)
│  none
│
◇  Which package manager do you want to install dependencies with?
│  bun

$ cd sveltekit-bun-app

$ bun dev --open

this works ok, then

$ bun add -D svelte-adapter-bun

update svelte.config.js

// import adapter from "@sveltejs/adapter-auto";
import adapter from "svelte-adapter-bun";

create build

$ bun --bun run build

test build

$ bun --bun build/index.js

works ok

compile app

$ bun build build/index.js --compile --outfile bun-server
  [34ms]  bundle  32 modules
  [99ms] compile  bun-server

$ ll -h bun-server
-rwxrwxrwx 1 sas sas 93M Dec 12 12:43 bun-server*

execute it

$ ./bun-server
Listening on 0.0.0.0:3000

assets cannot be found

Image

console output:

$ ./bun-server 
Listening on 0.0.0.0:3000
error: Not found: /
      at new SvelteKitError (/$bunfs/root/bun-server:992:7)
      at /$bunfs/root/bun-server:18538:18
      at resolve2 (/$bunfs/root/bun-server:18449:29)
      at resolve (/$bunfs/root/bun-server:18396:42)
      at /$bunfs/root/bun-server:18394:49

error: Not found: /favicon.png
      at new SvelteKitError (/$bunfs/root/bun-server:992:7)
      at /$bunfs/root/bun-server:18538:18
      at resolve2 (/$bunfs/root/bun-server:18449:29)
      at resolve (/$bunfs/root/bun-server:18396:42)
      at /$bunfs/root/bun-server:18394:49

What is the expected behavior?

the app to work ok

What do you see instead?

the pasted screenshot

Additional information

same issue happens with deno: denoland/deno#26155 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant