I’m really happy to see Cloudflare add

I’m really happy to see Cloudflare add support for Playwright with Browser Rendering. I’m attempting to use it on a project, but I’m running in to errors when attempting to deploy. As soon as I include the “@Cloudflare/playwright” package in my build, deploys fail. My guess is that there could be something in that package that isn’t supported in the Workers run time?
✘ [ERROR] A request to the Cloudflare API (/accounts/4f453aab7846de127d0e18aec26d1576/workers/scripts/locum-jobs/versions) failed.

Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')
at null.<anonymous> (assets/app-YABV1Xlm.js:39099:31) in hasFlag
at null.<anonymous> (assets/app-YABV1Xlm.js:39115:7) in requireSupportsColors
at null.<anonymous> (assets/app-YABV1Xlm.js:39564:29)
at null.<anonymous> (assets/app-YABV1Xlm.js:39694:5) in requireColors
at null.<anonymous> (assets/app-YABV1Xlm.js:39702:19)
at null.<anonymous> (assets/app-YABV1Xlm.js:39704:5) in requireSafe
at null.<anonymous> (assets/app-YABV1Xlm.js:39707:19)
[code: 10021]
✘ [ERROR] A request to the Cloudflare API (/accounts/4f453aab7846de127d0e18aec26d1576/workers/scripts/locum-jobs/versions) failed.

Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')
at null.<anonymous> (assets/app-YABV1Xlm.js:39099:31) in hasFlag
at null.<anonymous> (assets/app-YABV1Xlm.js:39115:7) in requireSupportsColors
at null.<anonymous> (assets/app-YABV1Xlm.js:39564:29)
at null.<anonymous> (assets/app-YABV1Xlm.js:39694:5) in requireColors
at null.<anonymous> (assets/app-YABV1Xlm.js:39702:19)
at null.<anonymous> (assets/app-YABV1Xlm.js:39704:5) in requireSafe
at null.<anonymous> (assets/app-YABV1Xlm.js:39707:19)
[code: 10021]
3 Replies
darren
darrenOP3w ago
I'm using the nodejs_compat compatibility flag and 2025-03-05 for the compatibility date. I also have this for the browser binding.
[browser]
binding = "BROWSER"
[browser]
binding = "BROWSER"
Rui Figueira
Rui Figueira2w ago
Hi @darren which version are you using? Can you provide a minimal code example that reproduces the error?
darren
darrenOP2w ago
Hi Rui, apologies for the late reply. I ended up just using the new rest endpoint which seemed to work ok. I was using the latest version as of April 14th, but I no longer have to code available to say exactly what version that was. As far as how to reproduce, I was just seeing that as soon as I imported the @cloudflare/playwright package, deploys would fail. Even if I never actually used any of the imports. My app would build ok, but it seemed to fail when uploading.

Did you find this page helpful?