raaymaxR
Deno15mo ago
raaymax

How to workaround `deno compile` binary file limitations?

In my app I'm using
sharp
and after compile it looses the ability to load dll.
❯ ./server
error: Uncaught (in promise) Error: Could not load the "sharp" module using the darwin-arm64 runtime
undefined: dlopen(/var/folders/4f/6rr3fjvx2wq742xvnz3lf1740000gn/T/deno-compile-server/Chat/node_modules/.deno/@img+sharp-darwin-arm64@0.33.0/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node, 0x0001): tried: '/var/folders/4f/6rr3fjvx2wq742xvnz3lf17)
Possible solutions:
- Add platform-specific dependencies:
    npm install --os=darwin --cpu=arm64 sharp
  or
    npm install --force @img/sharp-darwin-arm64
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (file:///var/folders/4f/6rr3fjvx2wq742xvnz3lf1740000gn/T/deno-compile-server/Chat/node_modules/.deno/sharp@0.33.0/node_modules/sharp/lib/sharp.js:85:9)
    at Object.<anonymous> (file:///var/folders/4f/6rr3fjvx2wq742xvnz3lf1740000gn/T/deno-compile-server/Chat/node_modules/.deno/sharp@0.33.0/node_modules/sharp/lib/sharp.js:88:4)
    at Module._compile (node:module:736:34)
    at Object.Module._extensions..js (node:module:757:11)
    at Module.load (node:module:655:32)
    at Function.Module._load (node:module:523:13)
    at Module.require (node:module:674:19)
    at require (node:module:801:16)
    at Object.<anonymous> (file:///var/folders/4f/6rr3fjvx2wq742xvnz3lf1740000gn/T/deno-compile-server/Chat/node_modules/.deno/sharp@0.33.0/node_modules/sharp/lib/constructor.js:10:1)
    at Object.<anonymous> (file:///var/folders/4f/6rr3fjvx2wq742xvnz3lf1740000gn/T/deno-compile-server/Chat/node_modules/.deno/sharp@0.33.0/node_modules/sharp/lib/constructor.js:446:4)

Is there any way to workaround this problem?
Was this page helpful?