#Could not load the "sharp" module using the linux-arm64 runtime

3 messages · Page 1 of 1 (latest)

summer arch
#

I'm trying to use sharp package and get this error when running bunx convex dev

I've tried sharp versions: 0.33.5 and latest, 0.34.4, same result every time.
I've configured convex.json in root directory (same as package.json) as:

{
  "$schema": "https://raw.githubusercontent.com/get-convex/convex-backend/refs/heads/main/npm-packages/convex/schemas/convex.schema.json",
  "node": {
    "nodeVersion": "22",
    "externalPackages": ["sharp"]
  }
}

All related files/actions have "use node" directive.

Output of bunx convex dev --once --debug-node-apis:

✔ Provisioned a dev deployment and saved its name as CONVEX_DEPLOYMENT to .env.local

Write your Convex functions in convex/
Give us feedback at https://convex.dev/community or [email protected]
View the Convex dashboard at https://dashboard.convex.dev/d/{project}

Bundling convex entry points one at a time to track down things that can't be bundled for the Convex JS runtime.
A patch update is available for Convex (1.27.1 → 1.27.3)
Changelog: https://github.com/get-convex/convex-js/blob/main/CHANGELOG.md#changelog
✔ All non-'use node' entry points successfully bundled. Skipping rest of push.
✔ 19:34:25 Convex functions ready! (16.24s)

Versions:

convex: 1.27.1
sharp: 0.33.5 | 0.34.4
bun: 1.2.21
silent egretBOT
#

Thanks for posting in #1088161997662724167.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.

    - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
    - Use [search.convex.dev](https://search.convex.dev) to search Docs, Stack, and Discord all at once.
    - Additionally, you can post your questions in the Convex Community's #1228095053885476985 channel to receive a response from AI.
    - Avoid tagging staff unless specifically instructed.

    Thank you!
summer arch
#

Error (message was too long):

✖ Error fetching POST  https://{domain}.convex.cloud/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 endpoints/emailInbound.js: Could not load the "sharp" module using the linux-arm64 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=arm64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at <anonymous> (../../../../../node_modules/sharp/lib/sharp.js:112:33)
    at <anonymous> (convex:/user/_deps/node/5W4JR7FT.js:12:31)
    at <anonymous> (../../../../../node_modules/sharp/lib/constructor.js:12:0)
    at <anonymous> (convex:/user/_deps/node/5W4JR7FT.js:12:31)
    at <anonymous> (../../../../../node_modules/sharp/lib/index.js:6:24)
    at <anonymous> (convex:/user/_deps/node/5W4JR7FT.js:12:31)
    at <anonymous> (../../../convex/util/convertImage.ts:4:43)