charoitel / lambda-layer-canvas-nodejs

Cairo backed Mozilla Web Canvas API implementation layer for AWS Lambda
https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:990551184979:applications~lambda-layer-canvas-nodejs
MIT License
87 stars 22 forks source link

Error: node-canvas was built without SVG support #4

Closed kozo002 closed 3 years ago

kozo002 commented 3 years ago

@charoitel Thank you for your great job. This saved lots of my time.

Although an error occurred in my lambda function, so I share the error log.

2021-06-10T03:56:35.901Z    4ca4fa3a-3b60-5c6b-98ad-a301b4c819ab    ERROR   Error: node-canvas was built without SVG support
    at setSource (/opt/nodejs/node_modules/canvas/lib/image.js:91:13)
    at Image.set (/opt/nodejs/node_modules/canvas/lib/image.js:62:9)
    at /var/task/socialImageDesigns/common.js:133:19
    at new Promise (<anonymous>)
    at Object.loadImage (/var/task/socialImageDesigns/common.js:125:12)
    at Object.create (/var/task/socialImageDesigns/textNote-type1-ver1.js:63:41)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async /var/task/socialImages.js:30:35
    at async Promise.all (index 0)
    at async Runtime.exports.main [as handler] (/var/task/socialImages.js:11:5)

Will you be planed to rebuild node-canvas with librsvg ? The same error was reported in the node-canvas repo and the cause is building without librsvg => https://github.com/Automattic/node-canvas/issues/1484#issuecomment-640255501

charoitel commented 3 years ago

@kozo002 Thanks for raising the issue here, I have updated the release on AWS Serverless Application Repository. Please try again with the latest release and let me know if there is still any issue?

You may have to deploy again in order to create a new layer version in your AWS Lambda console. Thank you.