railwayapp / nixpacks

App source + Nix packages + Docker = Image
https://nixpacks.com
MIT License
2.66k stars 242 forks source link

error ```node:internal/modules/cjs/loader:1183``` #97

Closed Remco0o closed 2 years ago

Remco0o commented 2 years ago

i get this error if i run my code and the deploy is active after that he crash

node:internal/modules/cjs/loader:1183
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: libuuid.so.1: cannot open shared object file: No such file or directory
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/app/node_modules/canvas/lib/bindings.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1099:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'ERR_DLOPEN_FAILED'
}
Node.js v17.9.0
coffee-cup commented 2 years ago

Can you please provide some more info on the error. Things like language, version of dependencies, and build plan would help debug this.

Even better would be a minimal repo that this error can be reproduced on.

jzeuzs commented 2 years ago

Can you try setting the NIXPACKS_PKGS environment variable to nixos.libuuid?

https://search.nixos.org/packages?channel=21.11&show=libuuid&from=0&size=50&sort=relevance&type=packages&query=libuuid

Remco0o commented 2 years ago

Can you try setting the NIXPACKS_PKGS environment variable to nixos.libuuid?

https://search.nixos.org/packages?channel=21.11&show=libuuid&from=0&size=50&sort=relevance&type=packages&query=libuuid

don't work

Remco0o commented 2 years ago

Can you please provide some more info on the error. Things like language, version of dependencies, and build plan would help debug this.

Even better would be a minimal repo that this error can be reproduced on.

I use nodejs version 17.9 and if i start the repo he build it but after a succesfull deploy i get that error

coffee-cup commented 2 years ago

This is not enough to go on. Can you provide a repo that we can use to reproduce the error on?

Remco0o commented 2 years ago

This is not enough to go on. Can you provide a repo that we can use to reproduce the error on?

the one on github?

coffee-cup commented 2 years ago

Sure

Remco0o commented 2 years ago

Sure

it is a private repo

Milo123459 commented 2 years ago

What about an MRE?

Remco0o commented 2 years ago

What about an MRE?

??

Milo123459 commented 2 years ago

Minimal reproduction example

Remco0o commented 2 years ago

Minimal reproduction example

how do that

Milo123459 commented 2 years ago

Please share your package.json, I'll try figure it out.

Remco0o commented 2 years ago

Please share your package.json, I'll try figure it out.


  "name": "pixelleader",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "ascii-table": "0.0.9",
    "axios": "^0.27.2",
    "canvacord": "^5.2.3",
    "chalk": "^2.4.1",
    "discord-canvas": "^1.4.1",
    "discord-nsfw": "^1.3.0",
    "discord-together": "^1.3.3",
    "discord.js": "^13.6.0",
    "generate-password": "^1.7.0",
    "glob": "^7.2.0",
    "got": "^11.8.3",
    "moment": "^2.29.1",
    "moment-duration-format": "^2.3.2",
    "mongoose": "^6.3.1",
    "pretty-ms": "^7.0.1",
    "node-fetch": "^2.6.1"
  },

  "engines": {
    "node": "17.x",
      "os": "linux",
     "cpu": "x64"
  }
}
ghost commented 2 years ago

This is not enough to go on. Can you provide a repo that we can use to reproduce the error on?

Done! https://github.com/wyzlle/nixpacks-bug-97

All packages/repo that use node-canvas are affected. It works fine with heroku's buildpacks though.

Can you try setting the NIXPACKS_PKGS environment variable to nixos.libuuid?

Installing util-linux and/or libuuid didn't fix this. I suspect this is something to do with how nixpacks installs nix.

Remco0o commented 2 years ago

This is not enough to go on. Can you provide a repo that we can use to reproduce the error on?

Done! https://github.com/wyzlle/nixpacks-bug-97

All packages/repo that use node-canvas are affected. It works fine with heroku's buildpacks though.

Can you try setting the NIXPACKS_PKGS environment variable to nixos.libuuid?

Installing util-linux and/or libuuid didn't fix this. I suspect this is something to do with how nixpacks installs nix.

Find the problem and no fix at this moment

Strooss commented 1 year ago

This is not enough to go on. Can you provide a repo that we can use to reproduce the error on?

Done! https://github.com/wyzlle/nixpacks-bug-97 All packages/repo that use node-canvas are affected. It works fine with heroku's buildpacks though.

Can you try setting the NIXPACKS_PKGS environment variable to nixos.libuuid?

Installing util-linux and/or libuuid didn't fix this. I suspect this is something to do with how nixpacks installs nix.

Find the problem and no fix at this moment

did you find a solution?