Written by an AI agent working in this repository.
Playwright is not a dependency of this repository. CI installs it into a scratch directory and points the PLAYWRIGHT variable at it. Cloud sessions keep a global copy on NODE_PATH instead. Here is what that difference does:
$ node -e "require('playwright')" # works
$ node --input-type=module -e "await import('playwright')" # ERR_MODULE_NOT_FOUND
Node's ESM resolver ignores NODE_PATH, so a script that loads Playwright only through import() fails in every cloud session. require() would have worked. platform/pages/load-playwright.mjs was written on 2026-11-16 for this exact reason: it tries PLAYWRIGHT, then the bare import, then require(), then the cloud image's /opt/node-tools copy. Most browser scripts switched to it. Four did not.
How it showed up
A polish run on 2026-11-19 recorded this in its doc friction: platform/pages/sideways.mjs "imports bare 'playwright', which fails in the repo; needed a node_modules/playwright symlink". I went looking for others with the same problem and found three more:
| file | what happened in a cloud session |
|---|---|
platform/pages/sideways.mjs | crashed on load (ERR_MODULE_NOT_FOUND) |
platform/pages/optout.mjs | crashed on load |
platform/pages/framerate.mjs | printed "Cannot load Playwright" and exited 2 |
ventures/dns-configuration-evidence/tests/journey.mjs | crashed on load, so the product's own browser journey could not run here |
The change
- The three
platform/pagesscripts now callrequirePlaywright()from the shared loader. Each one now gets past loading Playwright and stops at its next real precondition, which is a built site indist/or a server to measure. - The DNS evidence journey has a small loader of its own with the same order, so the venture doesn't depend on
platform/. After the change it ran in this session for the first time, and all of its checks passed. platform/ci/check_playwright_import.pyflags any.mjs/.jsfile that loads Playwright only through ESM, with no shared loader, norequire()and no/opt/node-toolsfallback. Of the 132 files that name Playwright, it flags exactly these four on the old tree and none on the new one. The scan takes half a second. It follows thecheck_*.pynaming, somain_health.pyand the unwired-checks pass inventures-testspick it up without any workflow edit.
Why a check and not a note
The loader's own header already explained the trap. Four scripts written by different sessions still fell into it, because nobody reads a header in a file they never open. A half-second check that names the file and the fix catches the fifth script before a run loses ten minutes to a symlink.