oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
72.98k stars 2.66k forks source link

Single Flight server actions - SolidStart (notes example) #12191

Open birkskyum opened 2 months ago

birkskyum commented 2 months ago

What version of Bun is running?

1.1.17+bb66bba1b

What platform is your computer?

Darwin 23.5.0 arm64 arm

What steps can reproduce the bug?

Create project:

Run:

What is the expected behavior?

New note is saved

What do you see instead?

Internal server error in browser console

Terminal shows:

➜ bun --bun run dev
$ vinxi dev
vinxi v0.3.12
vinxi starting dev server

  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

8:48:05 AM [vite] ✨ new dependencies optimized: marked
8:48:05 AM [vite] ✨ optimized dependencies changed. reloading
[h3] [unhandled] 1 | export default "native";
    ^
error: Unexpected end of JSON input
      at json (native:1:1)

1 | export default "native";
    ^
SyntaxError: Unexpected end of JSON input
      at json (native:1:1)

Additional information

No response

birkskyum commented 1 month ago

@paulo-assoc - The latest version of the Notes example appear to be working, after fixes on the solid side. It uses a new version of the solid-router/solid-start that has some bugs fixed, so updating will fix the issue with the same version of bun (1.1.18).

Let me know if you still see issues.

paulo-assoc commented 1 month ago

@birkskyum I still didn't work:

PS C:\Users\paulo\source\repos\solid-bun> bun run --bun dev $ vinxi dev --port 3004 vinxi v0.3.14 vinxi starting dev server

➜ Local: http://localhost:3004/ ➜ Network: use --host to expose

[h3] [unhandled] 1 | export default "native"; ^ error: Unexpected end of JSON input at json (native:1:1)

1 | export default "native"; ^ SyntaxError: Unexpected end of JSON input at json (native:1:1)

I used Bun 1.1.18.

Here is my package,json:

{ "name": "example-notes", "type": "module", "scripts": { "dev": "vinxi dev --port 3004", "build": "vinxi build", "start": "vinxi start --port 3004" }, "dependencies": { "@solidjs/router": "^0.14.1", "@solidjs/start": "^1.0.4", "@types/marked": "^4.3.1", "date-fns": "^2.30.0", "solid-js": "^1.8.18", "marked": "^4.3.0", "unstorage": "1.10.1", "vinxi": "^0.3.14" }, "engines": { "node": ">=18" } }

paulo-assoc commented 1 month ago

@birkskyum It worked for you?

birkskyum commented 1 month ago

@birkskyum It worked for you?

Yes. A notes version of older versions still break, but not the latest

birkskyum commented 1 month ago

@paulo-assoc , it crashes for me again now too with. a new repo...

paulo-assoc commented 1 month ago

@birkskyum I tried it with an update of an existing repo and with a new repo using "bun create solid". Either way it crashes with bun 1.1.18 on Windows.

bun run --bun dev $ vinxi dev --port 3004 vinxi v0.3.14 vinxi starting dev server

➜ Local: http://localhost:3004/ ➜ Network: use --host to expose

[h3] [unhandled] 1 | export default "native"; ^ error: Unexpected end of JSON input at json (native:1:1)

1 | export default "native"; ^ SyntaxError: Unexpected end of JSON input at json (native:1:1)

paulo-assoc commented 1 month ago

@birkskyum You must have an update I don't have. Thoughts?

birkskyum commented 1 month ago

@paulo-assoc , I don't know why it seemed like it worked briefly... must be a fluke, or there could be a race condition involved.

paulo-assoc commented 1 month ago

Thanks, @birkskyum! I want you to know that I appreciate you.

paulo-assoc commented 1 month ago

Any updates, @birkskyum?

birkskyum commented 1 month ago

@paulo-assoc , not that I'm aware of. This is what's being worked on right now. The merger of the node:cluster appear to be in progress, so hopefully this will be picked up at some point when the top tickets are resolved.

paulo-assoc commented 1 month ago

Thanks for the update, @birkskyum!