canvas icon indicating copy to clipboard operation
canvas copied to clipboard

Can't deploy on Vercel

Open Autometrique opened this issue 2 years ago • 3 comments

@napi-rs/canvas breaks my deployment on Vercel

It's working fine on local.

"@napi-rs/canvas": "^0.1.44" "next": "^13.4.19", npm version: 10.1.0 screencapture

I have all the optional dependencies :

"node_modules/@napi-rs/canvas": {
      "version": "0.1.44",
      "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.44.tgz",
      "integrity": "sha512-IyhSndjw29LR1WqkUZvTJI4j8Ve1QGbZYtpdQjJjcFvsvJS4/WHzOWV8ZciLPJBhrYvSQf/JbZJy5LHmFV+plg==",
      "engines": {
        "node": ">= 10"
      },
      "optionalDependencies": {
        "@napi-rs/canvas-android-arm64": "0.1.44",
        "@napi-rs/canvas-darwin-arm64": "0.1.44",
        "@napi-rs/canvas-darwin-x64": "0.1.44",
        "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.44",
        "@napi-rs/canvas-linux-arm64-gnu": "0.1.44",
        "@napi-rs/canvas-linux-arm64-musl": "0.1.44",
        "@napi-rs/canvas-linux-x64-gnu": "0.1.44",
        "@napi-rs/canvas-linux-x64-musl": "0.1.44",
        "@napi-rs/canvas-win32-x64-msvc": "0.1.44"
      }
    },

Autometrique avatar Sep 12 '23 22:09 Autometrique

I finally managed to make it work by adding the module to the experimental "serverComponentsExternalPackages" in the next.config.js. Hope it will help others

experimental: {
		serverComponentsExternalPackages: ['@napi-rs/canvas']
	  },

Autometrique avatar Sep 12 '23 23:09 Autometrique

Is this on the Hobby plan? When I use it on Vercel, it never installs any of the optional dependencies. Does it work correctly if the optional dependencies are not installed?

k-tten avatar Jan 05 '24 08:01 k-tten