-
Notifications
You must be signed in to change notification settings - Fork 377
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
[Bug?]: New solid start doesn't work with yarn berry #1177
Comments
If we are basing it on the esbuild log, then this is an esbuild issue, not SolidStart's. Pardon me because I don't see anything related to SolidStart's setup. |
@danieltroger I get this ➜ yarn add @esbuild/android-arm64 This could be related to the environment / hardware / os you use, and the compatibility with that, yarn berry and @esbuild/android-arm64. It's probably best to open an issue on it in here: https://github.com/evanw/esbuild/issues with as much information about your setup as possible |
@birkskyum thanks for testing. For some reason it now works flawlessly - However, now when doing
Let me know if it doesn't happen for you |
@danieltroger , when i use yarn 1.x it works alright (both install and dev server), but with berry I always have a new package failing to install, like: ➜ yarn
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0082: │ npm-run-path@npm:^5.1.0: No candidates found
➤ YN0000: └ Completed in 0s 475ms
➤ YN0000: · Failed with errors in 0s 487ms or deleting node modules and retrying: ➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0082: │ lru-cache@npm:^10.0.2: No candidates found
➤ YN0000: └ Completed in 5s 713ms
➤ YN0000: · Failed with errors in 5s 722ms so it looks like to me that yarn berry is flaky. |
berry has a different module resolution so it may or may not be Berry's fault. |
I've never seen this flake before in yarn 3+ and I've been using it professionally for ~2 years 😅 Maybe that's because we have It seems like there's an issue for it already: yarnpkg/berry#5989 |
i tried deleting all the yarn things:
I then ran:
My result was: ➜ yarn
➤ YN0087: Migrated your project to the latest Yarn version 🚀
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0082: │ npm-run-path@npm:^5.1.0: No candidates found
➤ YN0000: └ Completed in 1s 989ms
➤ YN0000: · Failed with errors in 2s 1ms |
Did you also delete the yarn folder in your home directory?
|
oh way, the on in ~/.yarn I missed! now I get: ➜ yarn
➤ YN0065: Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry
➤ YN0065: Run yarn config set --home enableTelemetry 0 to disable
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @solidjs/meta@npm:0.29.3, @solidjs/router@npm:0.10.5, @solidjs/start@npm:0.4.2, solid-js@npm:1.8.7, and 621 more.
➤ YN0000: └ Completed in 7s 937ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 559 packages were added to the project (+ 168.09 MiB).
➤ YN0000: └ Completed in 2s 624ms
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.18.20 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.19.10 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 2s 62ms
➤ YN0000: · Done in 12s 684ms |
Epic, it worked! Now try |
Hello world counter works as expected ➜ yarn dev
start {
appRoot: './src',
ssr: true,
islands: false,
server: { base: undefined },
solid: {}
}
vinxi hook app:config-resolved 11:43:09 AM
vinxi hook app:created 11:43:10 AM
vinxi Found vite.config.js with app config
/*404
/
/*404
/
➜ Local: http://localhost:3000/
➜ Network: use --host to expose |
Whaatt, I'll also try clearing all my caches then |
What's your node version btw? |
v18.19.0 |
Can you try on |
sure, I swapped to node 20.10.0 using |
Interesting, what about 21.5.0? |
checked just now - 21.5.0 works as well for me. |
I tried adding the Vite 5 resolution as well: "resolutions": {
"vite": "5"
}, that that works as well for me. both |
Soo weird. I'm back on 21.5.0 now. Deleted
|
Can you send me your |
Thanks, here's my whole directory if running |
Same issue even with your lockfile 🤨 this is peak weird. Do you think it'd be more helpful if I tried to dig into the actual issue or created a Dockerfile that reproduces the issue for you? |
WAIT, you don't happen to get a node_modules folder for some reason? Can you set |
it seems like I was able to reproduce your error when using the |
@birkskyum Ok so I debugged it all the way, seems like indeed jiti is to blame. The issue is this: the import However it doesn't, because jiti does not provide the correct This causes yarn to fallback to its Which means it doesn't find anything in Hacky workaround that might work in this specific case and break other things would be to slap a @birkskyum can you take it from here with opening a relevant issue at vinxi or jiti? I need to eat something and then continue building a website. Lmk if you need more details, I have a screen recording of the debugging session |
But we probably don't want it to fallback to nativeRequire. We are only shipping ESM code. So it needs to be picked up using ESM imports. Jiti is there for typescript support in the app.config file. One optimization can be to remove Jiti for just JS files since they should be native node compatible. but i'm worried yarn berry is doong something with placing files weirdly in node_modules that makes typical resolve algorithms miss this. It should have been found in the block above your breakpoint. |
Also is there something better I can use than jiti for loading our config files which might be ts? Should I go the vite route and bundle the config file with esbuild first? |
nksaraf/vinxi#60 should help with js config files. |
Latest vinxi release (0.0.58) should have fixed this if you |
In what screenshot?
Great, thanks. I think this is a good workaround for now but it would be even better with a more long-term fix, given that solid-start has a vite.config.ts file by default. Maybe Jiti could fix their code to request the Also I'm now getting
Instead. Anyone know what that could be? |
I think a new solid-start release is needed with the internal deps fixed. The plugin directives needs to be bumped with the fixed version. @ryansolid |
@nksaraf I bumped vinxi with
I'll try to dig into that one now because I have HMR issues with css files in old solid-start and maybe it's fixed in the new one. |
Holy hell, if this was what you meant with "fixing internal deps" then that + renaming vite.config.ts to vite.config.js indeed did the trick! 🥳
|
I've also suggested moving Vinxi to 1.0 to fix the resolution since 0.0.x doesn't follow the same scheme as >0.1.x |
I'll do the shift within this week. Just want to get done with all the bugs that have already been filed |
Ok new SolidStart is released at 0.4.3. Not sure that changes anything but thought I'd let you all know. |
just tested, the issue persist with 0.4.3 and these "no candidate found" errors: ➜ yarn
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0082: │ @esbuild/android-arm64@npm:0.19.11: No candidates found
➤ YN0000: └ Completed in 3s 773ms
➤ YN0000: · Failed with errors in 3s 783ms |
@birkskyum but that was just the yarn glitch, right? Do |
@danieltroger , oh yes forgot about that - I get this on ➜ yarn
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @solidjs/start@npm:0.4.3, solid-js@npm:1.8.8, vinxi@npm:0.1.1, @ampproject/remapping@npm:2.2.1, and 647 more.
➤ YN0000: └ Completed in 7s 183ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 585 packages were added to the project (+ 179.13 MiB).
➤ YN0000: └ Completed in 5s 114ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ esbuild@npm:0.18.20 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.19.11 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1s 188ms
➤ YN0000: · Done with warnings in 13s 555ms and on ➜ yarn run dev
vinxi 0.1.1
Error: Package subpath './lib/chunks' is not defined by "exports" in /Users/admin/.yarn/berry/cache/vinxi-npm-0.1.1-32d0d0bf47-10c0.zip/node_modules/vinxi/package.json imported from /Users/admin/repos/solid-kitchen/my-app-bare-4.3/.yarn/__virtual__/@vinxi-server-functions-virtual-d4c1e43827/4/.yarn/berry/cache/@vinxi-server-functions-npm-0.1.0-39311db440-10c0.zip/node_modules/@vinxi/server-functions/
Require stack:
- /Users/admin/repos/solid-kitchen/my-app-bare-4.3/.yarn/__virtual__/@vinxi-server-functions-virtual-d4c1e43827/4/.yarn/berry/cache/@vinxi-server-functions-npm-0.1.0-39311db440-10c0.zip/node_modules/@vinxi/server-functions/client.js
at require$$0.Module._resolveFilename (/Users/admin/repos/solid-kitchen/my-app-bare-4.3/.pnp.cjs:13149:13)
at Function.resolve (node:internal/modules/helpers:136:19) |
@birkskyum nice! Really appreciate you testing this end-to end. The issue you got now is the one you get past by renaming vite.config.ts to vite.config.js.
|
Hi @nksaraf, did you have time to look into why it's not possible to build (https://github.com/danieltroger/vinxi-repro)? |
I opened unjs/jiti#204 and unjs/mlly#221. Seems like mlly is a completely homegrown module resolver that has absolutely no idea of yarn berry so it's going to be interesting to see how this develops. @nksaraf do you know why solid-start needs mlly? In the meantime I made a patch that can be applied via
mlly-npm-1.5.0-dc7923db5f.patch
|
I would be happy to help investigating any upstream compatibility issues within UnJS ecosystem but highly appreciate making minimal reproductions to investigate 🙏🏼 |
Some notes here: unjs/jiti#204 (comment) TLDR: While this is a complex issue, there are some things can help to resolve issues faster in solid/vinxi side:
|
I don't know how much loading speed will be helped by making config a type only util. The things it imports (mostly lazily) are also going to be imported anyway during load to start the app. Make the entry point runnable is desirable for an architecture that is meant to be totally in the users control. Mlly and jiti are right now used for running typescript config files. I am probably going to go the way of vite and use esbuild to quickly transpile the config file .. and then load that. |
Vite is a direct dependency of Vinxi. Does solid start also need to make it a dependency ? |
Would it make sense to make solidjs/start depend on vinxi which depended on vite, instead of installing vinxi / |
Try Anyway, if you like to go with a less consistent way with Nitro and UnJS ecosystem, that's your decision ;)
Yes, for string pnp any dependency should be explicitly defined. |
Duplicates
Latest version
Current behavior 😯
Expected behavior 🤔
yarn install
should complete successfullySteps to reproduce 🕹
Follow this terminal log:
Context 🔦
I want to use the latest version of yarn which is fast and also supports
yarn link
so I can link my locally built packages.Your environment 🌎
Node v21.5.0 on macOS 14.2.1 (23C71) M1 Max 16" MacBook Pro
The text was updated successfully, but these errors were encountered: