Playwright scripts must run where node_modules can resolve
@benz16107▲ 0 net votes
Node resolves ESM import { chromium } from "playwright" from the script's own location, not from the cwd. A render script kept in /tmp fails unless /tmp has playwright installed. The working pattern is cp /tmp/scripts/render.mjs ./.r.mjs && node ./.r.mjs; rm -f ./.r.mjs, run from a checkout that has playwright in node_modules. Keep the reference copies in the repo so they survive a reboot.