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

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

Closed
birkskyum opened this issue Jun 27, 2024 · 18 comments
Closed

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

birkskyum opened this issue Jun 27, 2024 · 18 comments
Labels
bug Something isn't working needs triage

Comments

@birkskyum
Copy link
Collaborator

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:

  • bun create solid@latest
  • Is this a Solid-Start project? Yes
  • Which template would you like to use? Notes
  • Use Typescript? Yes

Run:

  • bun i
  • bun --bun run dev
  • Go to http://localhost:3000/
  • Click "New"
  • Fill in "Title" and "Description"
  • Click "Done"

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 serverLocal:    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 birkskyum added bug Something isn't working needs triage labels Jun 27, 2024
@birkskyum birkskyum mentioned this issue Jun 27, 2024
2 tasks
@birkskyum birkskyum changed the title Single Flight server actions - SolidStart Single Flight server actions - SolidStart (notes example) Jun 27, 2024
@birkskyum
Copy link
Collaborator Author

birkskyum commented Jul 11, 2024

@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
Copy link

@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
Copy link

@birkskyum It worked for you?

@birkskyum birkskyum reopened this Jul 11, 2024
@birkskyum
Copy link
Collaborator Author

birkskyum commented Jul 11, 2024

@birkskyum It worked for you?

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

@birkskyum
Copy link
Collaborator Author

birkskyum commented Jul 11, 2024

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

@paulo-assoc
Copy link

@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
Copy link

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

@birkskyum
Copy link
Collaborator Author

birkskyum commented Jul 14, 2024

@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
Copy link

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

@paulo-assoc
Copy link

Any updates, @birkskyum?

@birkskyum
Copy link
Collaborator Author

birkskyum commented Jul 26, 2024

@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
Copy link

Thanks for the update, @birkskyum!

@birkskyum
Copy link
Collaborator Author

birkskyum commented Sep 7, 2024

@paulo-assoc , with the new Bun 1.1.27, this seems to be working.
Let me know if you still see problems.

@paulo-assoc
Copy link

Wow! I tested the SolidStart notes app with Bun 1.1.27 on Windows 11 and found no issues. Thanks, @birkskyum!

@paulo-assoc
Copy link

@birkskyum Does this mean we can safely use solid start with Bun? Or are there other known issues?

@birkskyum
Copy link
Collaborator Author

birkskyum commented Sep 7, 2024

SolidStart appear to be quite well supported now - i've used it in prod for a while, without this missing feature. There are some auth packages / vitest / http2 things left that aren't in place yet, which could prove problematic - as noted here, but thats the same for everyone. I.e. sveltekit here, and I think the planned crypto rewrite is what ultimately will unlock these tickets - so there's nothing solidstart-specific left to my knowledge.

@paulo-assoc
Copy link

@birkskyum I didn't see any mention of this big news in the release notes for Bun 1.1.27.

@birkskyum
Copy link
Collaborator Author

birkskyum commented Sep 7, 2024

@paulo-assoc , i'm also not sure which PR made the difference (best guess is this #13744 ), but I'm glad it works.

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

2 participants