cakeC
Convex Community7mo ago
3 replies
cake

Convex not able to find sharp in my mono-repo. Looking in wrong `node_modules`.

We're using bun for the package manager / builder of a monorepo with a convex server. We recently added sharp to create some thumbnails inside of convex, and now we're seeing an error:

✖ Error fetching POST  http://{domain}/api/deploy2/start_push 400 Bad Request: InvalidModules: Hit an error while pushing:
Loading the pushed modules encountered the following
    error:
Uncaught Failed to analyze utils/fileHandler.js: Could not load the "sharp" module using the linux-x64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=linux --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install


The error goes , if we symlink the root node_modules into the convex-server dir.

This seems likely to be a common problem and I'm curious if there is a better solution to this.
Was this page helpful?