node-gfx / node-canvas-prebuilt

Repo used to build binaries for node-canvas on CI
169 stars 31 forks source link

When running in AWS LambdaI get undefined symbol: _ZN2v87Isolate19CheckMemoryPressureEv #70

Closed liftyourgame closed 5 years ago

liftyourgame commented 5 years ago

When I use node-canvas-prebuilt on AWS Lambda via Serverless.com I get:

/var/lang/bin/node: symbol lookup error: /var/task/node_modules/canvas-prebuilt/canvas/build/Release/canvas.node: undefined symbol: _ZN2v87Isolate19CheckMemoryPressureEv

Using node v8.10. I read somewhere that this might be fixed on v8.12 but the latest version of Node supported by AWS is 8.10

package.json

{ "description": "Service to server side render chart.js charts", "scripts": { "lint": "eslint --ext .js ." }, "dependencies": { "canvas": "2.2.0", "chart.js": "^2.7.3", "chartjs-node-canvas": "^1.1.11", "serverless": "^1.35.1", "static-eval": "^2.0.0" }, "devDependencies": { "eslint": "^4.19.1", "eslint-config-airbnb-base": "^12.1.0", "eslint-friendly-formatter": "^4.0.1", "eslint-plugin-html": "^4.0.3", "eslint-plugin-import": "^2.7.0", "eventsource-polyfill": "^0.9.6", "serverless-offline": "^3.31.3" } }

zbjornson commented 5 years ago

See https://github.com/Automattic/node-canvas/issues/1252#issuecomment-431711821. There's nothing we can do about this unf. Lambda supports custom runtimes now, so you should be able to any version of Node.js you want (https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html).