diff --git a/package.json b/package.json index b126c0dbc0..f1808a78ca 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,8 @@ ], "patchedDependencies": { "@earendil-works/pi-coding-agent": "patches/@earendil-works__pi-coding-agent.patch", - "@earendil-works/pi-tui": "patches/@earendil-works__pi-tui.patch" + "@earendil-works/pi-tui": "patches/@earendil-works__pi-tui.patch", + "playwright-core@1.59.1": "patches/playwright-core@1.59.1.patch" } } } diff --git a/patches/playwright-core@1.59.1.patch b/patches/playwright-core@1.59.1.patch new file mode 100644 index 0000000000..81d44c2d87 --- /dev/null +++ b/patches/playwright-core@1.59.1.patch @@ -0,0 +1,24 @@ +diff --git a/lib/server/utils/nodePlatform.js b/lib/server/utils/nodePlatform.js +index 80d88fedf2c4d2b7bea8cfd4b9c8db454dedaa1d..670f37ff62fd984361b7cfac62e54064a416139d 100644 +--- a/lib/server/utils/nodePlatform.js ++++ b/lib/server/utils/nodePlatform.js +@@ -64,7 +64,18 @@ let boxedStackPrefixes = []; + function setBoxedStackPrefixes(prefixes) { + boxedStackPrefixes = prefixes; + } +-const coreDir = import_path.default.dirname(require.resolve("../../../package.json")); ++// Wrapped in try-catch for Bun compiled binaries: require.resolve() with ++// relative paths gets converted to absolute build-machine paths that don't ++// exist at runtime. The __dirname fallback computes the same playwright-core ++// root structurally (this file lives at playwright-core/lib/server/utils/). ++// Upstream: https://github.com/oven-sh/bun/pull/29066 ++let coreDir; ++try { ++ coreDir = import_path.default.dirname(require.resolve("../../../package.json")); ++} catch (e) { ++ if (e.code !== 'MODULE_NOT_FOUND') throw e; ++ coreDir = import_path.default.resolve(__dirname, "../../.."); ++} + const nodePlatform = { + name: "node", + boxedStackPrefixes: () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dcd7bdfaa9..c075824508 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ patchedDependencies: '@earendil-works/pi-tui': hash: e432fee0f54b7321d104a08ff5a38561d9c2cd3b002f34e6b8cbc2377889c9d2 path: patches/@earendil-works__pi-tui.patch + playwright-core@1.59.1: + hash: 1f27acbc8250451c9eea2efa9b19956afcb881a2b7a69ad4550cf8e59f15e102 + path: patches/playwright-core@1.59.1.patch importers: @@ -3571,11 +3574,11 @@ snapshots: pkce-challenge@5.0.1: {} - playwright-core@1.59.1: {} + playwright-core@1.59.1(patch_hash=1f27acbc8250451c9eea2efa9b19956afcb881a2b7a69ad4550cf8e59f15e102): {} playwright@1.59.1: dependencies: - playwright-core: 1.59.1 + playwright-core: 1.59.1(patch_hash=1f27acbc8250451c9eea2efa9b19956afcb881a2b7a69ad4550cf8e59f15e102) optionalDependencies: fsevents: 2.3.2