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:
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.3 Replies
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 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!
sharp must be marked as an external package, see: https://docs.convex.dev/functions/bundling#external-packages
Also try to search for "sharp" in this discord, youll find several threads about this package specifically. im having further troubles in my repo thats a pnpm turbo monorepo since the hoisting behavior doesnt play well with external package marking. but in simpler repo setups the link above works just fine!
Bundling | Convex Developer Hub
How Convex bundles and optimizes your function code
Thank you!