canvas
canvas copied to clipboard
Can't deploy on Vercel
@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
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"
}
},
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']
},
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?