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.
No description
4 Replies
kian
kian13mo ago
I'd probably want to debug why the Worker itself isn't working first - what issue are you having with it?
monkev_see_monkev_do
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
monkev_see_monkev_do
This is the code I replaced it with:
/**
* Welcome to Cloudflare Workers! This is your first worker.
*
* - Run "npm run dev" in your terminal to start a development server
* - Open a browser tab at http://localhost:8787/ to see your worker in action
* - Run "npm run deploy" to publish your worker
*
* Learn more at https://developers.cloudflare.com/workers/
*/

export default {
async fetch(request, env, ctx) {
return new Response('Hello World!');
},
};
/**
* Welcome to Cloudflare Workers! This is your first worker.
*
* - Run "npm run dev" in your terminal to start a development server
* - Open a browser tab at http://localhost:8787/ to see your worker in action
* - Run "npm run deploy" to publish your worker
*
* Learn more at https://developers.cloudflare.com/workers/
*/

export default {
async fetch(request, env, ctx) {
return new Response('Hello World!');
},
};
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
No description
monkev_see_monkev_do
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
Jumpshare
Screenshot 2023-12-09 at 10.41.02 AM.png
Shared with Jumpshare
Want results from more Discord servers?
Add your server