oscklmO
Convex Community2y ago
4 replies
oscklm

Convex.json external packages not installing, pnpm monorepo

So there seems to be a lack of externalPackages to support a monorepo, like ours which uses node-linker=hoisted in a .npmrc

The node-linker hoisted flattens and causes all modules to be installed in the root node_modules folder.

So when we define externalPackages, in our convex.json like this:

{
  "node": {
    "externalPackages": ["sharp"]
  }
}


The external packages doesn't get installed when running convex dev

Comparing to a non monorepo project, this works without problems.


A bit of a forced workaround, that solves the issue:
Manually moving a "sharp" module from the root node_modules, into the packages/backend/node_modules, will solve this issue. But seems like a bit of a forceful workaround. Even though it does work.
Was this page helpful?