fix(browser): patch playwright-core for Bun WebSocket compatibility
Bun's WebSocket implementation doesn't fully support Playwright's CDP connection because Playwright bundles its own 'ws' module. This causes connectOverCDP to timeout. The patch makes Playwright use the native 'ws' module when running under Bun, which works with Bun's WebSocket shim. Fixes browser snapshot/act timeouts after PR #278 (tsx → bun migration). Ref: https://github.com/oven-sh/bun/issues/9911
This commit is contained in:
@@ -152,7 +152,8 @@
|
||||
},
|
||||
"patchedDependencies": {
|
||||
"@mariozechner/pi-ai": "patches/@mariozechner__pi-ai.patch",
|
||||
"qrcode-terminal": "patches/qrcode-terminal.patch"
|
||||
"qrcode-terminal": "patches/qrcode-terminal.patch",
|
||||
"playwright-core@1.57.0": "patches/playwright-core@1.57.0.patch"
|
||||
}
|
||||
},
|
||||
"vitest": {
|
||||
@@ -186,5 +187,10 @@
|
||||
"apps/macos/.build/**",
|
||||
"dist/Clawdbot.app/**"
|
||||
]
|
||||
},
|
||||
"patchedDependencies": {
|
||||
"@mariozechner/pi-ai": "patches/@mariozechner__pi-ai.patch",
|
||||
"qrcode-terminal": "patches/qrcode-terminal.patch",
|
||||
"playwright-core@1.57.0": "patches/playwright-core@1.57.0.patch"
|
||||
}
|
||||
}
|
||||
|
||||
13
patches/playwright-core@1.57.0.patch
Normal file
13
patches/playwright-core@1.57.0.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/lib/utilsBundle.js b/lib/utilsBundle.js
|
||||
index 7dd8831f29c19f2e20468508b77b0a3f9d204ae6..c50a1ac2b3439a5b2fbf8afa61c369360710071f 100644
|
||||
--- a/lib/utilsBundle.js
|
||||
+++ b/lib/utilsBundle.js
|
||||
@@ -59,7 +59,7 @@ const program = require("./utilsBundleImpl").program;
|
||||
const ProgramOption = require("./utilsBundleImpl").ProgramOption;
|
||||
const progress = require("./utilsBundleImpl").progress;
|
||||
const SocksProxyAgent = require("./utilsBundleImpl").SocksProxyAgent;
|
||||
-const ws = require("./utilsBundleImpl").ws;
|
||||
+const ws = "Bun" in globalThis ? require("ws") : require("./utilsBundleImpl").ws;
|
||||
const wsServer = require("./utilsBundleImpl").wsServer;
|
||||
const wsReceiver = require("./utilsBundleImpl").wsReceiver;
|
||||
const wsSender = require("./utilsBundleImpl").wsSender;
|
||||
Reference in New Issue
Block a user