-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support SolidStart #3736
Comments
Repro:
|
@birkskyum can you upgrade to canary and give it another try? |
Update for canary (hash 3418feb) solid-start: 0.3.4 (Currently active version)Result of above repro:
In more advanced cases (an app I work on) I get this result now using both Bun and Node adapter:
Blocked by |
Tried ➜ bun --bun run dev -- --open
$ solid-start dev --open
solid-start dev
version 0.3.2
error: Cannot find package "preact" from "file:///Users/admin/repos/my-solid-app/node_modules/local-pkg/index.mjs"
[bun] Warning: worker_threads.Worker option "execArgv" is not implemented. |
yes pls We've ported a SS project over to bun, but get this
|
Which adapter do you use? |
|
any docs for adaptors? |
@quantuminformation , not sure I understand |
import solid from 'solid-start/vite';
import { defineConfig } from 'vite';
import dotenv from 'dotenv';
export default defineConfig(() => {
dotenv.config();
return {
plugins: [solid()],
test: {
deps: {
registerNodeLoader: true,
},
environment: 'jsdom',
globals: true,
setupFiles: ['node_modules/@testing-library/jest-dom/extend-expect'],
transformMode: { web: [/\.[jt]sx?$/] },
},
ssr: {
external: ['@prisma/client'],
},
};
}); |
@marcusbuffett, I believe it's this ticket - it's not implemented: |
@birkskyum I believe the worker thing isn't the main problem, it's the |
my issue was fixed moving to node 18 from 16 |
Tried to run an example of the upcoming solid-start release. It's still WIP, so I expected bugs, but interestingly this example does work fine in node, but breaks with bun: solid-start/examples/bare on vinxi [$!?] via ⬢ v18.19.0 took 4.1s
➜ bun --bun run dev
$ vinxi dev
36 | );
37 | }
38 |
39 | export function defineConfig(baseConfig = {}) {
40 | let { plugins = [], ssr = true, start = {}, ...userConfig } = baseConfig;
41 | const extensions = [...DEFAULT_EXTENSIONS, ...(start.extensions || [])];
^
ReferenceError: Cannot access uninitialized variable.
at defineConfig (/Users/admin/repos/solid-start/packages/start/config/index.js:41:25)
at evalModule (/Users/admin/repos/solid-start/node_modules/.pnpm/jiti@1.21.0/node_modules/jiti/dist/jiti.js:1:256441)
at jiti (/Users/admin/repos/solid-start/node_modules/.pnpm/jiti@1.21.0/node_modules/jiti/dist/jiti.js:1:254369)
at /Users/admin/repos/solid-start/node_modules/.pnpm/c12@1.5.1/node_modules/c12/dist/index.mjs:288:15
at resolveConfig (/Users/admin/repos/solid-start/node_modules/.pnpm/c12@1.5.1/node_modules/c12/dist/index.mjs:234:29)
at /Users/admin/repos/solid-start/node_modules/.pnpm/c12@1.5.1/node_modules/c12/dist/index.mjs:116:39
at loadConfig (/Users/admin/repos/solid-start/node_modules/.pnpm/c12@1.5.1/node_modules/c12/dist/index.mjs:86:26)
at /Users/admin/repos/solid-start/node_modules/.pnpm/vinxi@0.0.48_debug@4.3.4_rollup@3.28.1/node_modules/vinxi/lib/load-app.js:35:28
at processTicksAndRejections (:61:76)
vinxi hook app:config-resolved 3:10:47 AM
vinxi hook app:created It claims that
|
There was a big new release on the solid-start side (@solidjs/start 0.4), but the error: |
As the latest version, it seems to be that Probably connected issue: #267 |
The only issue I still face is the server part of http2 missing when https is turned on in localhost (which is quite common). Otherwise everything runs - do any of you still experience issues with latest versions of start (>= 0.4.3) and vinxi (>= 0.1.1)? |
New versions seem to have fixed things here... |
Body parsing does not seem to work in solidstart production builds with bun (works with node): not sure if it is a bun or solidstart bug. Example code: export const POST = async (event: APIEvent) => {
console.log(await event.request.json());
return new Response('ok');
}; The request hangs forever, instead of resolving. |
If it works in node, it's to be considered a bug in bun - rule of thumb |
Unless, they are doing some if-else thing specifically to handle bun, which has a bug :) Since nitro seems to have a specific bun adapter and preset, I would assume those have a bug somewhere, since it is not node code that is running. |
Good point :) |
I am suspecting it is a h3 bug (or some h3 bun compatibility issue) since SolidStart uses h3 for api calls. |
Wonder if related |
I have a weird bug with bun not being able to perform the $ bunx --bun vinxi build
⚙ Preparing app for bun...
ERROR { [ENOENT: No such file or directory] 3:09:45 PM
code: 'ENOENT',
path:
'[absolute path]/public/.../scene.bin',
syscall: 'copyfile',
errno: -2 }
ERROR No such file or directory 3:09:45 PM
ELIFECYCLE Command failed with exit code 1.
``` |
Solid-start notes sample app still fails with Bun v1.1.8 with this output in the console (when trying to save a new note): bun run --bun dev ➜ Local: http://localhost:3004/ [h3] [unhandled] 1 | export default "native"; 1 | export default "native"; |
Seems like this is the last piece missing now for initial support: ➜ bun run --bun dev
$ vinxi dev
vinxi v0.3.11
vinxi starting dev server
➜ Local: http://localhost:3000/
➜ Network: use --host to expose
12:46:32 AM [vite] ✨ new dependencies optimized: marked
12:46:32 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) |
Thanks, @birkskyum. Perhaps you can create a new issue with a more specific than "Support SolidStart". This worked great with #11260. |
I'll try to see if I can get more out of the debug build of the bun binary |
The bun-debug outputs lots of things, but ends up with this failed assertion when saving a new note: [SYS] onUpdate kevent (fd: 36) Reader
[SYS] onPoll(36) = 33
[SYS] recv(36, 262144) = 33 0.013ms
[SYS] recv(36, 262111) = EAGAIN 0.006ms
[SYS] register: FilePoll(0x20000de0100, generation_number=8) readable (36)
[FileReader] onReadChunk() = 33 (drained)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[SYS] send(35, 13) = 13
[FileSink] onWrite(13, src.io.PipeWriter.WriteStatus.drained)
[Loop] sub 8 - 0 = 8
[FileReader] onPull(16384) = pending
[SYS] onKQueueEvent: FilePoll(fd=42, generation_number=11) = poll_readable | readable | one_shot | has_incremented_poll_count | was_ever_registered | socket
[SYS] onUpdate kevent (fd: 42) Reader
[SYS] onPoll(42) = 33
[SYS] recv(42, 262144) = 33 0.014ms
[SYS] recv(42, 262111) = EAGAIN 0.006ms
[SYS] register: FilePoll(0x20022280060, generation_number=11) readable (42)
[FileReader] onReadChunk() = 33 (drained)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[SYS] send(41, 13) = 13
[FileSink] onWrite(13, src.io.PipeWriter.WriteStatus.drained)
[Loop] sub 1 - 0 = 1
[FileReader] onPull(16384) = pending
[SYS] onKQueueEvent: FilePoll(fd=7, generation_number=3) = poll_readable | readable | one_shot | has_incremented_poll_count | was_ever_registered | socket
[SYS] onUpdate kevent (fd: 7) Reader
[SYS] onPoll(7) = 33
[SYS] recv(7, 262144) = 33 0.082ms
[SYS] recv(7, 262111) = EAGAIN 0.007ms
[SYS] register: FilePoll(0x20000de0060, generation_number=3) readable (7)
[FileReader] onReadChunk() = 33 (drained)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[SYS] send(6, 13) = 13
[FileSink] onWrite(13, src.io.PipeWriter.WriteStatus.drained)
[Loop] sub 8 - 0 = 8
[FileReader] onPull(16384) = pending
[SYS] onKQueueEvent: FilePoll(fd=36, generation_number=8) = poll_readable | readable | one_shot | has_incremented_poll_count | was_ever_registered | socket
[SYS] onUpdate kevent (fd: 36) Reader
[SYS] onPoll(36) = 33
[SYS] recv(36, 262144) = 33 0.016ms
[SYS] recv(36, 262111) = EAGAIN 0.008ms
[SYS] register: FilePoll(0x20000de0100, generation_number=8) readable (36)
[FileReader] onReadChunk() = 33 (drained)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[SYS] send(35, 13) = 13
[FileSink] onWrite(13, src.io.PipeWriter.WriteStatus.drained)
[Loop] sub 8 - 0 = 8
[FileReader] onPull(16384) = pending
[SYS] onKQueueEvent: FilePoll(fd=42, generation_number=11) = poll_readable | readable | one_shot | has_incremented_poll_count | was_ever_registered | socket
[SYS] onUpdate kevent (fd: 42) Reader
[SYS] onPoll(42) = 33
[SYS] recv(42, 262144) = 33 0.018ms
[SYS] recv(42, 262111) = EAGAIN 0.019ms
[SYS] register: FilePoll(0x20022280060, generation_number=11) readable (42)
[FileReader] onReadChunk() = 33 (drained)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[SYS] send(41, 13) = 13
[FileSink] onWrite(13, src.io.PipeWriter.WriteStatus.drained)
[Loop] sub 1 - 0 = 1
[FileReader] onPull(16384) = pending
[SYS] onKQueueEvent: FilePoll(fd=7, generation_number=3) = poll_readable | readable | one_shot | has_incremented_poll_count | was_ever_registered | socket
[SYS] onUpdate kevent (fd: 7) Reader
[SYS] onPoll(7) = 33
[SYS] recv(7, 262144) = 33 0.014ms
[SYS] recv(7, 262111) = EAGAIN 0.023ms
[SYS] register: FilePoll(0x20000de0060, generation_number=3) readable (7)
[FileReader] onReadChunk() = 33 (drained)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[SYS] send(6, 13) = 13
[FileSink] onWrite(13, src.io.PipeWriter.WriteStatus.drained)
[Loop] sub 8 - 0 = 8
[FileReader] onPull(16384) = pending
[SYS] onKQueueEvent: FilePoll(fd=36, generation_number=8) = poll_readable | readable | one_shot | has_incremented_poll_count | was_ever_registered | socket
[SYS] onUpdate kevent (fd: 36) Reader
[SYS] onPoll(36) = 33
[SYS] recv(36, 262144) = 33 0.015ms
[SYS] recv(36, 262111) = EAGAIN 0.007ms
[SYS] register: FilePoll(0x20000de0100, generation_number=8) readable (36)
[FileReader] onReadChunk() = 33 (drained)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[SYS] send(35, 13) = 13
[FileSink] onWrite(13, src.io.PipeWriter.WriteStatus.drained)
[Loop] sub 8 - 0 = 8
[FileReader] onPull(16384) = pending
[SYS] onKQueueEvent: FilePoll(fd=42, generation_number=11) = poll_readable | readable | one_shot | has_incremented_poll_count | was_ever_registered | socket
[SYS] onUpdate kevent (fd: 42) Reader
[SYS] onPoll(42) = 33
[SYS] recv(42, 262144) = 33 0.017ms
[SYS] recv(42, 262111) = EAGAIN 0.007ms
[SYS] register: FilePoll(0x20022280060, generation_number=11) readable (42)
[FileReader] onReadChunk() = 33 (drained)
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[SYS] send(41, 13) = 13
[FileSink] onWrite(13, src.io.PipeWriter.WriteStatus.drained)
[Loop] sub 1 - 0 = 1
[FileReader] onPull(16384) = pending
[RequestContext] create (src.bun.js.api.server.NewRequestContext(false,true,src.bun.js.api.server.NewServer(ZigGeneratedClasses.JSDebugHTTPServer,false,true))@200077d0100)
[alloc] new() = src.bun.js.api.Timer.TimerObject@13c904140
[alloc] destroy() = src.bun.js.api.Timer.TimerObject@16e004080
[RequestContext] toAsync
[RequestContext] onBufferedBodyChunk 376 true
[EventLoop] enter() = 0
[BodyValue] resolve
[EventLoop] exit() = 0
[EventLoop] enter() = 0
[EventLoop] exit() = 0
[h3] [unhandled] 1 | export default "native";
^
error: Unexpected end of JSON input
at json (native:1:1)
at asyncFunctionResume (:2:22)
at promiseReactionJobWithoutPromiseUnwrapAsyncContext (:2:22)
at promiseReactionJob (:2:22)
at native:1:1
1 | export default "native";
^
SyntaxError: Unexpected end of JSON input
at json (native:1:1)
at asyncFunctionResume (:2:22)
at promiseReactionJobWithoutPromiseUnwrapAsyncContext (:2:22)
at promiseReactionJob (:2:22)
at native:1:1
|
@birkskyum What build of Bun did you test with? |
Main branch, bun-debug, and I just build it with this guide https://bun.sh/docs/project/contributing 1.1.10-debug+323011980 |
All those "EAGAIN" doesn't look that healthy either, and that's even before clicking the save button. Related |
Latest commit on main looks like this: [Subprocess] updateHasPendingActivity() true - true
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/@solidjs/router/dist/routing.js) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/@solidjs/router/dist/routing.js) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/@solidjs/router/dist/routing.js])
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/@solidjs/router/dist/utils.js) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/@solidjs/router/dist/utils.js) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/@solidjs/router/dist/utils.js])
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/@solidjs/router/dist/routing.js) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/@solidjs/router/dist/routing.js) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/@solidjs/router/dist/routing.js])
[napi] napi_get_value_bool
[napi] napi_create_promise
[napi] napi_create_string_utf8: napi_rs_async_work
[napi] napi_create_async_work
[napi] napi_queue_async_work
[Loop] ref 1000 + 1 = 1001
[napi] napi_get_value_bool
[napi] napi_create_promise
[napi] napi_create_string_utf8: napi_rs_async_work
[napi] napi_create_async_work
[napi] napi_queue_async_work
[Loop] ref 1001 + 1 = 1002
[FileReader] onPull(16384) = pending
[napi] napi_resolve_deferred
[napi] napi_delete_async_work
[Loop] sub 10 - 1 = 9
[napi] napi_resolve_deferred
[napi] napi_delete_async_work
[Loop] sub 9 - 1 = 8
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/dist/server.js) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/dist/server.js) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/dist/server.js])
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/dist/package.json) = -1
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/package.json) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/package.json) = 38
[SYS] fstat(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/package.json]) = 0
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/package.json], 1331) = 1315 (0.011ms)
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/package.json], 16) = 0 (0.002ms)
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/solid-js/store/package.json])
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/package.json) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/package.json])
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/package.json) = 38
[SYS] fstat(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/package.json]) = 0
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/package.json], 158102) = 158086 (0.016ms)
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/package.json], 16) = 0 (0.002ms)
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/package.json])
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/index.mjs) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/index.mjs) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/date-fns/index.mjs])
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json])
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json) = 38
[SYS] fstat(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json]) = 0
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json], 3581) = 3565 (0.003ms)
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json], 16) = 0 (0.002ms)
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json])
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/lib/marked.esm.js) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/lib/marked.esm.js) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/lib/marked.esm.js])
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/lib/package.json) = -1
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json) = 38
[SYS] fstat(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json]) = 0
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json], 3581) = 3565 (0.003ms)
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json], 16) = 0 (0.001ms)
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/marked/package.json])
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/package.json) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/package.json])
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/package.json) = 38
[SYS] fstat(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/package.json]) = 0
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/package.json], 4056) = 4040 (0.003ms)
[SYS] read(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/package.json], 16) = 0 (0.001ms)
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/package.json])
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/dist/index.mjs) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/dist/index.mjs) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/dist/index.mjs])
[SYS] stat(/Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/drivers/fs-lite.mjs) = 0
[SYS] openat(-2, /Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/drivers/fs-lite.mjs) = 38
[SYS] close(38[/Users/admin/repos/bun-kitchensink/nodtes/node_modules/unstorage/drivers/fs-lite.mjs])
[h3] [unhandled] 1 | export default "native";
^
error: Unexpected end of JSON input
at json (native:1:1)
at asyncFunctionResume (:1:11)
at promiseReactionJobWithoutPromiseUnwrapAsyncContext (:1:11)
at promiseReactionJob (:1:11)
at native:1:1
1 | export default "native";
^
SyntaxError: Unexpected end of JSON input
at json (native:1:1)
at asyncFunctionResume (:1:11)
at promiseReactionJobWithoutPromiseUnwrapAsyncContext (:1:11)
at promiseReactionJob (:1:11)
at native:1:1
|
Nice sleuthing, @birkskyum! How much closer does this get us to a resolution? |
Not so much unfortunately, but at least it seems like things are changing, and because all PRs have tests associated with them hopefully in a good direction. I mainly add the stacktraces, because they are searchable, like in the case of the "EAGAIN" which might have given us an open ticket to an issue which might be causing some sort of crash even before we click the "save note" button and see the JSON error. It looks file read/write related, and I see work being done in that area which is why I wanted to see what/if anything changed today. |
I appreciate what you're doing, @birkskyum! Was your test today using the latest canary build? |
Yes, it was using the latest commit from main (1.1.13-debug+60af98586) so that should be the same. |
Hi there! From the last messages I didn't really pickup the current status. Is it currently possible to start a simple Hello World app? I would really appreaciate solid start support! |
@BierDav , your milage might vary here, but a simple Hello World should be possible. The |
@birkskyum, thanks for your fast answer! I wanted to ask how to get this working, because the ´bun create` doesn't currenty work. I have already created an issue for that solidjs/solid-start#1535 |
Use pnpm/npm create solid, and then when the project is created, delete any pnpm/npm lockfile / node_modules and run |
Ok thanks, that worked. But is it also possible to use bun as a |
In summary, these are the issues related to SolidStart that users are highly likely to run into: |
Thanks, @birkskyum! These need 'bug' and 'triage' labels. |
with #2644 closed, Bun 1.1.27 works fine with SolidStart in my case |
Now that Vite (#250) is working, it's now time to start getting all of the vite-powered frameworks working.
The current blockers for SolidStart:
es-module-loader
Unified event loop #3741The text was updated successfully, but these errors were encountered: