Open jameshalsall opened 1 year ago
@jameshalsall Did you solve it by any chance? Thanks.
Unfortunately not. We just downgraded to an older version of node-canvas 😞
Unfortunately not. We just downgraded to an older version of node-canvas 😞
What version did you end up downgrading to?
2.11.0
This is probably happening because canvas is not being built from source - by default a pre-built canvas is downloaded.
I managed to make it work by running npm install --build-from-source=canvas
.
You will also need to install python3 and to keep cairo, libjpeg, etc. or copy them to ../canvas/build/Release. And you won't need LD_PRELOAD.
Issue or Feature
When deploying to AWS lambda using a Docker image we encounter the following error:
I believe this is related to the changes made here. It worked in version 2.11.0 without issue.
In the base image I am building from (https://gallery.ecr.aws/lambda/nodejs) we can see the version of
pango
is < 1.44.0, but for some reason the following condition evaluates to true when canvas is compiled:From canvas
src/CanvasRenderingContext2d.cc
:Version on the AWS Lambda image:
So I am a bit confused as to why the
pango_context_set_round_glyph_positions
call is being compiled in thecanvas
target.--
Steps to Reproduce
Example Dockerfile:
dist/example.js
:Your Environment
2.11.2
linux/amd64
), AWS Lambda (although reproduces locally), Node 18