Closed jakst closed 8 months ago
That is no good.. I haven’t looked at the rendering beta yet. But is env.BROWSER a url as a string?
No it's an instantiated class I believe. puppeteer.launch(endpoint: { fetch: typeof fetch })
is the signature, so I guess there's a fetch function in there.
Here's the code in the @cloudflare/puppeteer
package https://github.com/cloudflare/puppeteer/blob/35c54456f9f75eb2028569c51a269bbf22aad605/src/puppeteer-core.ts#L65
Hmm.. in that case it might confuse it with a service binding and something go wrong from there. I am currently on PTO, so probably won’t have time to look at it for a couple days.
That's alright, it's for a hobby project and I've patched your package with my workaround locally, so it's running fine for now. This will only start becoming painful if you start releasing a lot of new versions without fixing the bug ^^
No stress, and enjoy your time off!
I have a Durable Object in which I run Cloudflare's browser rendering beta. When wrapping the DO with
instrumentDO
the call topuppeteer.launch(this.env.BROWSER)
crashes with the following error:I managed to create a very hacky solution by patching this package in the following way:
node_modules/@microlabs/otel-cf-workers/dist/esm/wrap.js
This works for me for now, but I suspect there is a much better way to solve this in a first hand way.