Reputation: 28552
How do I put breakpoints and debug Cloudflare Workers? I've read the Cloudflare "Debugging Workers" guide, and unfortunately, it is not helpful.
It does mention:
Inserting console.log lines throughout your code can help you understand the state of your application in various stages until you reach the desired output.
I am wondering if anyone has figured out how to debug the application more thoroughly instead of console.log
, or a workaround to do this.
Thanks
One idea I had was to use a different service (GCP/Firebase cloud functions as a separate runtime / entrypoint which allows me to debug during development, which then helps. However, the Cloudflare environment is more restricted than your average cloud function/lambda (for performance reasons?). Might still be worth doing though.
Upvotes: 3
Views: 1351
Reputation: 45171
At present (March 2022), breakpoints are not yet supported by Cloudflare Workers. We'd like to support them eventually.
When breakpoints are supported, you'll be able to set them through the devtools UI, which appears when viewing a Worker through the preview UI.
Upvotes: 4