sst / ion

SST v3
https://sst.dev
MIT License
1.88k stars 221 forks source link

`server.install` does not work in `SolidStart` site #1110

Open ian-pascoe opened 1 week ago

ian-pascoe commented 1 week ago

When I try to deploy my solidstart site and add installs to the server function, they are not added.

To reproduce:

  1. Use SolidStart example
  2. Add server.install option
  3. Check deployed code and see that install was not executed
fwang commented 6 days ago

You are right. server.install has no effect on SolidStart sites. SolidStart uses Nitro behind the scene. Nitro packages the lambda code into .output/server. And SolidStart uses it as is.

What packages are you trying to bundle into the server lambda code?

ian-pascoe commented 6 days ago

I am trying to have sentry packages installed for instrumentation. The sentry docs want your sentry init file to be called via NODE_OPTIONS=‘—import instrumentation.mjs’ which makes it get shaken during build

fwang commented 6 days ago

Can u check if it can be configured in app.config.ts to include specific npm packages in the server build output?

/cc @thdxr do u know if it's possible?

ian-pascoe commented 6 days ago

I have tried several config options but it keeps getting shaken. I am about to go the lambda layer route if I can’t figure it out

fwang commented 6 days ago

Just talked to @thdxr, he's working on some stuff in this area. He will fix this.

For context, SolidStart's server output looks like this:

Screen Shot 2024-09-21 at 3 45 08 PM

We could inject server.install in package.json, and run npm install.