Fontconfig to canvas
Hi, I've been using the node-canvas in default railway when I use that, only libuuid and libGL are installed, through libs like:
fontconfig
.
Do you have any option to install the fontconfig
lib without create a custom Dockerfile? 4b5e343b-a630-49ff-8375-74a2e5bba62c49 Replies
Project ID:
4b5e343b-a630-49ff-8375-74a2e5bba62c
4b5e343b-a630-49ff-8375-74a2e5bba62c
give this nixpacks.toml file a shot
Can I follow these configs in nixpacks.toml to do commands too?
explain please
like a RUN in docker compose
RUN yarn lint
for example
inside a .toml file
Do you have a link to toml config file documentation?
oh great
let me see
this works
I think
Thanks! <:LINKSBR_vamo:1047304250096631858>
no problem
Works, I installed the libs
but
in fontconfig specific
It return this error:
Fontconfig error: Cannot load default config file
Do you have any way to config the font path like a:
export FONTCONFIG_PATH=/etc/fonts
install it as an apt package instead
let me try it
show me the nixpacks file before you push changes though
of course
Let me show you the errors.
In upper have the fontconfig error, down bellow has a out of memory error
what's the out of memory for?
you're on the hobby plan, that's 8gb of mem
Yeah, lol! haha
My app uses less 1gb
I belive it's because the fontconfig
then canvas join in looping
what kind of app is this
Is a nestjs app
a api
to create and handle some images
using canvas
simple app
show me the build table at the top of the build logs?
oh sure:
have you tried to set any variables related to font config yourself?
like that, right?
yeah, have you done that?
I didn't try
let me set this
and try again
you really shouldn't need to
I have a canvas project and all I needed to do was install fontconfig as an apt package and it worked
are you using node-canvas instead of canvas?
in package.json
is only canvas
GitHub
GitHub - Automattic/node-canvas: Node canvas is a Cairo backed Canv...
Node canvas is a Cairo backed Canvas implementation for NodeJS. - GitHub - Automattic/node-canvas: Node canvas is a Cairo backed Canvas implementation for NodeJS.
I followed
this steps
that's the same canvas version I use, but I do not have the fontconfig npm package
I'll remove that
because a have the apt fontconfig now
a guess would be that the npm fontconfig is messing something up
yeah
https://github.com/brody192/node-canvas-fonts
I install the fontconfig from within the railway.json, but it makes no difference
O sure
let me try
try what
uninstall the fontconfig from my npm
ah okay
and install with apt
Thanks again!
Fontconfig works now. But the out of memory error still happens. It's crazy because the server memory is bellow than 150mb
Is it possible that Node.js has a memory limit inside the container?
maybe the heap limit or something
yes, in my local machine run the same build works using 500mb in the max
That happens when start a new promise inside canvas, I'll search in canvas issues. Thanks Brody, you helped a lot with fontconfig!
try setting a service variable
NODE_OPTIONS
= --max-old-space-size=4096
the error still happen <a:I69_cat_Cry:989322598280224859>
what version of node do you use locally
16.16.0
in Win
railway uses node 16 something by default too
so we are back to code issue 🙂
yeah, I'll check in canvas issues
with nest idk...
thanks