Bun project with node-canvas not working
Hello, I'm trying to run a Discord Bot that uses node-canvas, but I'm getting some errors when it's running. Something to do with apt packages.
This is the repo: https://github.com/Communivents/ceramique
And the error:
GitHub
GitHub - Communivents/ceramique: Discord bot for the Communivents s...
Discord bot for the Communivents server. Contribute to Communivents/ceramique development by creating an account on GitHub.
16 Replies
Project ID:
e6306992-6a17-4995-84ea-cdbde3b351a7
e6306992-6a17-4995-84ea-cdbde3b351a7
Fixed it, but now getting an error:
And this now:
This is a code issue, not an issue with Railway. You'll be better off Googling this than waiting for a response here
I tested this on 3 machines and it doesn't work on railway so
Also I looked at every post on google and tried everything
This is during build?
No, runtime
Then it's a code error, sorry
It uses a compiled .node file so the error may go un noticed during build
If the error doesn't give enough information, I suggest logging more
I don't control the build step of node-canvas...
Did you not just say this is during runtime?
As in, post build?
The build step works: it creates a binding for cario.
Then when it is called, and only in railway, it crashes
I tried my binary on Mac, linux and windows and in all scenarios it worked
Found a couple Google results that may help, https://github.com/nodejs/docker-node/issues/277
https://github.com/Automattic/node-canvas/issues/1952
Add npm install ffi in your project, there's a missing binding
I'm not super experienced at js so I likely won't be able to help further, but those threads should be a good starting point for you
node-canvas is a mess
I ended up bumping the library I use
captcha-canvas
to v3 so it uses skia-canvas
instead
Now no errors
Thanks for helping 👍No prob
Also using this dockerfile: