sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.12k stars 133 forks source link

Unable to use sharp in Next.js Server Lambda #600

Open janus-reith opened 1 week ago

janus-reith commented 1 week ago

Im unsure wether this belongs here or in https://github.com/sst/open-next.

I have two Next.js projects that directly use sharp in API routes (not the separate handler for image optimization) and so far have failed to get it working. The deployment works, but the module can't be found when I invoke these routes that use sharp. Locally I'm on Darwin/arm64, use pnpm and the latest sharp 0.33.4.

So far I have tried:

I'm wondering if the ion or open-next internal logic for sharp might somehow prevent sharp from being bundled properly.

janus-reith commented 1 week ago

I wonder if this could be related: https://github.com/sst/ion/pull/548#issuecomment-2185556500 although I'm not sure if it's just relevant to the image optimization handler.