Issue with Playwright/Chromium dependencies in Nixpacks (Node.js)
serbiaserbia
PROOP

14 days ago

Hi Railway Support team,

I am currently deploying a Node.js application (OpenClaw) using the default Nixpacks build system. My application requires Playwright (Chromium) for browser automation tasks, but I am unable to get Chromium to launch successfully.

Even after trying several configuration steps, I consistently encounter the following error:

error while loading shared libraries: libnspr4.so: cannot open shared object file: No such file or directory

My openClaw is installed Railway template - https://github.com/codetitlan/openclaw-railway-template

What I have tried so far:

Setting NIXPACKS_PLAYWRIGHT_CHROME_DEPS=1 in environment variables.

Adding various packages to NIXPACKS_APT_PKGS (including libnss3, libnspr4, libgbm1, etc.).

Adding chromium to NIXPACKS_PKGS.

Creating a local Dockerfile and railway.toml in the workspace to force a Docker build, but the system seems to persist with the Nixpacks cached build or ignores the local overrides.

My goal:

I want to ensure that all necessary system-level dependencies for Playwright/Chromium are correctly installed and available in the runtime environment.

Could you please advise on the recommended way to handle Playwright dependencies within a Nixpacks-based Node.js deployment, or check why my environment variable overrides for APT packages aren't taking effect?

Thank you for your help!

$10 Bounty

1 Replies

Railway
BOT

14 days ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway 14 days ago


dawinz
HOBBYTop 10% Contributor

12 days ago

libnspr4.so is provided by the libnspr4 package, so if it's still missing at runtime, it usually means the package isn't actually being installed rather than Chromium itself being the problem.

A couple of things I'd check:

Verify that your service is actually using Nixpacks and not a cached Docker image. Triggering a Redeploy → Clear build cache can help confirm your NIXPACKS_* changes are being picked up.

Add a startup command like ldconfig -p | grep libnspr4 or find / -name libnspr4.so* to verify the library exists in the runtime image.

If you're using the openclaw-railway-template, make sure it hasn't pinned a Nixpacks configuration that overrides your environment variables.

Could you also share your NIXPACKS_APT_PKGS value and your deployment logs? That would help confirm whether the packages are actually being installed during the build.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...