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

2 years ago

Getting this error with puppeteer on Railway.

node:internal/modules/cjs/loader:1239

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: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. (/app/node_modules/.pnpm/canvas@2.11.2/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) {

code: 'ERR_DLOPEN_FAILED'

}

railway.toml

[phases.setup]
aptPkgs = ['...', 'libuuid1']
nixPkgs = ['...', 'libuuid1']
nixLibs = ["...", "libuuid", "libGL"]

[build]
nixpacksVersion = "1.15.0"

Project ID: 045e21af-ff58-4d2c-a95a-4147dea211c9
Service ID: c040e311-95df-41bf-82ff-e87da0aa84fe

Currently blocked on a release bc I can't get puppeteer to work

10 Replies

2 years ago

my current recommendation would be to not try installing chrome into the container, but instead use browserless

here is a working example of what that looks like in practice

this would also require you to switch to "puppeteer-core" instead of "puppeteer" so chrome isnt being installed, and your nixpacks.toml can be replaced with the nixpacks.toml thats in that repo.

doing it this way -

  • removes any head aches that come with installing chrome in docker.

  • improves build time significantly since chrome isnt being downloaded and installed on every deploy.

  • improves deploy time since chrome isnt bundled into the image anymore because a smaller image will deploy faster.


wilsonowilson
PROOP

2 years ago

I originally used browserless, but it's currently failing for scraping chrome web store URLs (it just hangs)
https://chromewebstore.google.com/detail/senja-testimonial-extensi/lmldakdjelendidnmaieidggbffljlle


2 years ago

the template I linked is an updated version of the template, give it a try


2 years ago

is that something you are trying to scrape or is that your app?


wilsonowilson
PROOP

2 years ago

Yeah we're using the latest version of everything.

On second thought, browserless just doesn't work at all when using page.goto. This snippet just hangs:

Hey! For some reason this code snippet no longer works:

browser = await puppeteer.connect({
browserWSEndpoint: process.env.BROWSER_ENDPOINT,
});

console.log("Connected to browser. Opening new page");
const page = await browser.newPage();
console.log("Page opened. Navigating to the chrome web store");
await page.goto("https://senja.io");

It just hangs at page.goto. Works fine using local puppeteer. Any ideas why?


wilsonowilson
PROOP

2 years ago

Ah fixed it, was an invalid flag


wilsonowilson
PROOP

2 years ago

Will try using browserless for this


2 years ago

have you deployed the linked template? it was very recently updated, recently meaning minutes before I sent my initial message in this thread


wilsonowilson
PROOP

2 years ago

Ah gotcha. I'm deploying it right now


2 years ago

and please do checkout my readme in the linked github


Loading...