#Netlify SSR assets _image api & Sharp not found

4 messages · Page 1 of 1 (latest)

spare kestrel
#

I can't seem to find any help or issues on this, but I can't seem to get a SSR deploy on netlify to bundle sharp into the entry function.

Output from the gets to /_image:

Server Error: MissingSharp: Could not find Sharp. Please install Sharp (`sharp`) manually into your project or migrate to another image service.

When I run this locally, it obviously works, and when I try netlify-dev I can see sharp included in the .netlify/functions/.../node_modules folder. Up in prod, for some reason it's a different story

What I've tried:

  • Including sharp in package.json
  • Forcing netlify to include sharp, via netlify toml
[functions]
included_files = ["node_modules/sharp/**/*"]
  • (Before 3.0): Using the squoosh service--which worked

Has anyone run into this?

vital ingotBOT
#
No-one around right now?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.

wind kindle
#

I have the same issue, but with Firebase Hosting.

wind kindle
#

you can get the file path by importing it as an asset with import filePathString from "file?url" but that includes it in the client build, as if the file was in public/