libuuid.so.1: cannot open shared object file: No such file or directory
Problem while trying to use ChartJS
My project was building perfectly until I tried to add ChartJS into it. Despite it working fully on my local PC, there is a problem with building it on Railway (probably because of
nixpacks
).
I tried asking Phind and researched other sources like using shell.nix to include proper libraries but seems like my understandning of that mechanism is not enough to handle it.
I need help. Anyone knows what difference Nixpacks make that make the problem occure? What should I do?Solution:Jump to solution
Solved
After adding
```json
"optionalDependencies": {
"node-canvas": "*"...
npm
canvas
Canvas graphics API backed by Cairo. Latest version: 2.11.2, last published: 4 months ago. Start using canvas in your project by running
npm i canvas
. There are 2394 other projects in the npm registry using canvas.8 Replies
Project ID:
3b6de31e-33a5-41ab-8405-07383c546f7b,a04e5aab-0452-4be2-b078-3e2d1e5a1503
Ok, found this mention in the nixpacks.docs:
(https://nixpacks.com/docs/providers/node)
Seems like since my project uses node canvas and not canvas it might be the case of why proper libraries are not added.
Gonna try this at home.
Node | Nixpacks
App source + Nix packages + Docker = Image
let me know if you needed any additional help with this as I've provided the complete solution for this to multiple people in the past
Solution
Solved
After adding
to
package.json
in main folder of the project despite it doing nothing in particular, Railway recongized the package and made libuuid and libGL available in the environment.
Be aware
node-canvas
is not an actual name of the package. It should be canvas
as stated in the docs.
https://www.npmjs.com/package/canvas
Despite that fact I added manually node-canvas
to the optional dependencies and it worked so I left it like that. If you try this solution, be sure to check if npm i canvas
won't be enough and feel free to post info about it here.
Note that optional dependencies don't need to really be succesfully installed, because npm ignores its instalation errors.npm
canvas
Canvas graphics API backed by Cairo. Latest version: 2.11.2, last published: 4 months ago. Start using canvas in your project by running
npm i canvas
. There are 2394 other projects in the npm registry using canvas.@strooss you had a problem with that
Yes i fixed that using docker file
I'm not using railway anyway as it's paid now
still 5$ free tho
5$ fee with 5$ in usage
https://github.com/railwayapp/nixpacks/blob/main/src/providers/node/mod.rs#L132
it's very off that the canvas package didn't work but node-canvas did