Gave this a go here, https://github.com/

Gave this a go here, https://github.com/mrbbot/miniflare-browser-worker-test, currently seeing ProtocolError: Protocol error (Browser.getVersion): Target closed. 😦 I don't have any more time to keep hacking on this today, but I'll leave it here if you wanted to take a look. Let me know if you get anywhere with it! 🙂
7 Replies
TravisFrank
TravisFrank12mo ago
Interesting, I'm getting a different error: Server failed WebSocket handshake: added Sec-WebSocket-Extensions when client did not offer any. As far as I can tell the client is responding with sec-websocket-extensions: permessage-deflate; client_max_window_bits=15, but I don't see the server sending any sec-websocket-extensions header, so I'm not sure what's going on Doh! The worker is the client in this scenario 🤦
MrBBot
MrBBotOP12mo ago
GitHub
workers-sdk/packages/miniflare/src/http/fetch.ts at 1b34878287e3c98...
⛅️ Home to Wrangler, the CLI for Cloudflare Workers® - cloudflare/workers-sdk
TravisFrank
TravisFrank12mo ago
Ah, probably - can you enlighten me on how this patches/miniflare+3.20231030.0.patch works? I see the change in that file, but is it being applied somehow?
MrBBot
MrBBotOP12mo ago
Ah looks like I missed out the postinstall in the package.json, should be a case of running npx patch-package
TravisFrank
TravisFrank12mo ago
Woah that is magic Okay now I have the same error you were getting: Protocol error (Browser.getVersion): Target closed.. I'll keep poking I'm noticing that WorkersWebSocketTransport.create is returning a transport with a WebSocket that has an empty string for protocol, which I think shouldn't be happening. Could be a red herring, but I'm not finding much else amiss.
TravisFrank
TravisFrank12mo ago
Also perhaps worth noting that this (https://github.com/mrbbot/miniflare-browser-worker-test/blob/main/src/index.ts#L27) isn't doing anything, since puppeteer.launch calls this.connect instead of endpoint.connect
GitHub
miniflare-browser-worker-test/src/index.ts at main · mrbbot/minifla...
Testing browser workers with Miniflare. Contribute to mrbbot/miniflare-browser-worker-test development by creating an account on GitHub.
MrBBot
MrBBotOP12mo ago
That connect() shouldn't be called, that's for TCP proxies (i.e. cloudflare:sockets stuff)
Want results from more Discord servers?
Add your server