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:
shamefullyHoist: true

hoistPattern:
- "!@solidjs/start"
- "!@solidjs/start/*"
- "!@solidjs/start/**"

publicHoistPattern:
- "!@solidjs/start"
- "!@solidjs/start/*"
- "!@solidjs/start/**"

# this one o4-mini insisted I add no matter how many times I told it I cannot find never-hoist in pnpm.io/settings#dependency-hoisting-settings
never-hoist:
- '@solidjs/start'
- '@solidjs/start/**'
shamefullyHoist: true

hoistPattern:
- "!@solidjs/start"
- "!@solidjs/start/*"
- "!@solidjs/start/**"

publicHoistPattern:
- "!@solidjs/start"
- "!@solidjs/start/*"
- "!@solidjs/start/**"

# this one o4-mini insisted I add no matter how many times I told it I cannot find never-hoist in pnpm.io/settings#dependency-hoisting-settings
never-hoist:
- '@solidjs/start'
- '@solidjs/start/**'
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 issue
10 Replies
foolswisdom
foolswisdom3d ago
I notice you don't have the **/@solidjs/start pattern
foolswisdom
foolswisdom3d ago
That 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-solid
foolswisdom
foolswisdom3d ago
That 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)
Ténèbres
TénèbresOP3d ago
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
"nohoist": [
"**/solid-start"
],
"nohoist": [
"**/solid-start"
],
**/solid-start? not **/@solidjs/start? 3. in example/package.json there is
"devDependencies": {
"@solidjs/start": "^1.1.3"
...
"devDependencies": {
"@solidjs/start": "^1.1.3"
...
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. 😮‍💨
foolswisdom
foolswisdom3d ago
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)
Ténèbres
TénèbresOP3d ago
🤔 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
foolswisdom
foolswisdom3d ago
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
Ténèbres
TénèbresOP3d ago
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
foolswisdom
foolswisdom3d ago
Maybe you could make a reproduction in repo that someone could look at?
Ténèbres
TénèbresOP3d ago
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...

Did you find this page helpful?