Cloudflare Worker Preview not working in the UI
I used the Cloudflare v4 API to create the Worker Route and Worker Script, but when I use the Cloudflare UI to test things out, it does not show the Preview. Even when I replace the Worker Script code, it still does not work.
Other notes:
- The Worker itself is also not working. Not sure if this is related to the preview not working.
- When I create a new Worker script, there is no issue with the preview
- I have inspected the settings for Workers that work and this one that has issue, but they don’t have any significant differences
- I’ve changed the URL in the preview and clicked the different tabs, etc.
4 Replies
I'd probably want to debug why the Worker itself isn't working first - what issue are you having with it?
If I change the code on the left-side to be a basic example, it still does not work. The Route is connected too.
Is there another debugging step I would take? Seems like the Script code does not execute
This is the code I replaced it with:
The button is always disabled:
https://jmp.sh/C7moyrpC
The real-time logs don't show anything when hitting the route: https://jmp.sh/bFzmCzvp
The route is setup properly:
- https://jmp.sh/xXAV21cE
- https://jmp.sh/1iKR9yme
Ok, after having my initial Workers Code back in the code editor and deployed, I can see that there are successful requests: https://jmp.sh/8k8SYfkh
But when going to a URL that matches the route, I'm unable to make further successful requests show up in the logs. I'm unsure where these 2 success requests came from. I'm now logging Real-time Logs, but it's hard to reproduce the successful requests.
I've been working with CF workers for a few months now, and unless I'm doing something wrong, this feels like a bug