libuuid.so.1: cannot open shared object file: No such file or directory

Project id: 3b6de31e-33a5-41ab-8405-07383c546f7b/service/a04e5aab-0452-4be2-b078-3e2d1e5a1503
Platform: Node.js v18.12.1
Used technologies: Nest.js / NPM
Repo: https://github.com/dudematthew/pla-manager/tree/production
Package.json: https://github.com/dudematthew/pla-manager/blob/production/package.json
Already tried: Changing package.json to use Node v16.x; Adding shell.nix file with needed library;
Project id: 3b6de31e-33a5-41ab-8405-07383c546f7b/service/a04e5aab-0452-4be2-b078-3e2d1e5a1503
Platform: Node.js v18.12.1
Used technologies: Nest.js / NPM
Repo: https://github.com/dudematthew/pla-manager/tree/production
Package.json: https://github.com/dudematthew/pla-manager/blob/production/package.json
Already tried: Changing package.json to use Node v16.x; Adding shell.nix file with needed library;
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).
Stack Trace:
...
[Nest] 32 - 08/01/2023, 2:01:03 PM ERROR [ExceptionHandler] libuuid.so.1: cannot open shared object file: No such file or directory
Error: libuuid.so.1: cannot open shared object file: No such file or directory
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1239:18)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Module.require (node:internal/modules/cjs/loader:1057:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/app/backend/node_modules/canvas/lib/bindings.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
Stack Trace:
...
[Nest] 32 - 08/01/2023, 2:01:03 PM ERROR [ExceptionHandler] libuuid.so.1: cannot open shared object file: No such file or directory
Error: libuuid.so.1: cannot open shared object file: No such file or directory
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1239:18)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Module.require (node:internal/modules/cjs/loader:1057:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/app/backend/node_modules/canvas/lib/bindings.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
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:
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.
Jump to solution
8 Replies
Percy
Percy16mo ago
Project ID: 3b6de31e-33a5-41ab-8405-07383c546f7b,a04e5aab-0452-4be2-b078-3e2d1e5a1503
HipsterSavage
HipsterSavage16mo ago
Ok, found this mention in the nixpacks.docs: (https://nixpacks.com/docs/providers/node)

Node Canvas

If node-canvas is found in the package.json file, then the libuuid and libGL libraries are made available in the environment.

Node Canvas

If node-canvas is found in the package.json file, then the libuuid and libGL libraries are made available in the environment.
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
Brody
Brody16mo ago
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
HipsterSavage
HipsterSavage16mo ago
Solved After adding
"optionalDependencies": {
"node-canvas": "*"
}
"optionalDependencies": {
"node-canvas": "*"
}
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.
HipsterSavage
HipsterSavage16mo ago
@strooss you had a problem with that
stroos
stroos16mo ago
Yes i fixed that using docker file I'm not using railway anyway as it's paid now
HipsterSavage
HipsterSavage16mo ago
still 5$ free tho
Brody
Brody16mo ago
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
Want results from more Discord servers?
Add your server