Solid Start in pnpm workspaces monorepo
Hi, does anyone know how to make solidstart work in a monorepo with pnpm workspaces ?
After seeing the section talking about monorepo support on solidstart readme,
I tried this in pnpm-workspace.yaml:
none of these work, I keep getting
Error: Cannot find module 'h3' imported from 'tenebres/root/packages/app/node_modules/vinxi/runtime/http.js'
maybe I'm on the wrong track ?
Please can anyone guide me 🤲
related issue10 Replies
I notice you don't have the
**/@solidjs/start
patternThat said, it looks like I'm only partially following the instructions in my monorepo here https://github.com/mosheduminer/lexical-solid (though I'm not importing from the package that uses start, it seems that some of the configuration is needed regardless)
GitHub
GitHub - mosheduminer/lexical-solid: SolidJS port of `@lexical/reac...
SolidJS port of
@lexical/react
. This port will be updated from time to time to maintain parity and keep dependencies fresh. - mosheduminer/lexical-solidThat said, the error you're getting doesn't seem like it's related to the issue described in the start readme 🤔
Okay, it seems like you don't need to specify this if you putting the configuration in package folder (it's either/or, which explains why in my project I just followed the instructions for configuring at the root)
hi @foolswisdom ! thanks for answering.
It's my first time working on a monorepo (alone) and I don't know much. Doing my best to understand
I've taken a look at your gh repo and haven't been able to see what I should deduce from it.
here's what I notice :
1. pnpm-workspace.yaml doesn't have a setting that would disable hoist for @solidjs/start, nor is there a .npmrc
2. there's the root package.json with
**/solid-start
? not **/@solidjs/start
?
3. in example/package.json there is
I thought I wouldn't have to add nohoist like in your repo, because I do not use yarn, I use pnpm.
I thought I had found the equivalent for nohoist with this setting, using exclamation point.
Even the overkill setting that is shamefullyHoist true which is supposed to help me when looking at the issue i linked in my earlier post isn't working.
Also, although I expected solidstart to be installed inside my root project node_modules, I never got it to be there whatever I've done.
😮💨Good point with 2, it's probably a relic of when the solid start package had a different name
Which makes it interesting that it nevertheless all works fine
It's quite possible you don't need any of this configuration for pnpm
And the error is unrelated (like I said, the readme describes an import issue of a specific script from solid start, not an issue importing h3)
🤔 but this works when not a monorepo
even if i install h3 in my app package, it will just tell me to install unctx... et caetera until i've installed all nitro dependencies
Regarding where the packages get installed - I think everything is installed in the root, but then again in the package (using symlinks, as pnpm does for all its installs)
Yes, the question is why is it not just working
Did you start from a template, or installing from scratch?
If installing from scratch, do you have both solid start and vinxi installed?
I'm not sure which one depends on h3, but probably it's vinxi
I started from template, built it out, decided I wanted to try out monorepo, started a new project in another directory, scaffolded it, copied what I had already worked on in the original repo
both solid start and vinxi are installed. I use vinxi dev to launch dev. error comes when navigating to localhost:3000
no trace of solid start in the stack traces
ah theres a trce
middle ware
idk
Maybe you could make a reproduction in repo that someone could look at?
yeah im gonna clean out my repo and retry
i'll send the reproduction repo as soon as i've cleaned my mess
and do an issue probably
thanks for being here, see you maybe
i managed to do it with a template...