Cloudflare

3. Workers not applied

I've just added a Worker on the Cloudflare Dashboard for my website: it works in the debugger but doesn't work when I query the site. Why is that? Is there anything to activate or anything I could check?


Dear User,

Thank you for reaching out about your issues wit Workers service. I'd like to help you with.

Based on your description, the Worker works in the debugger but not when querying the site. Here are a few steps to check and resolve common issues:

1. Ensure the Worker is Deployed.
Make sure that you have deployed the Worker and not just saved it in the Cloudflare dashboard. To deploy the Worker, navigate to the Workers tab, select your Worker, and click "Deploy".

2. Route Configuration.
Verify that the route for your Worker is correctly configured. Go to the Workers tab and check if the URL pattern (route) matches your website's URL. For example, if your website is https://example.com/*, ensure that this route is added to the Worker.

3. DNS Settings.
Ensure that your DNS settings are properly configured in Cloudflare. The DNS entry for your domain should be proxied (orange cloud icon) to ensure that traffic goes through Cloudflare’s network where the Worker can be applied.

4. Caching Issues.
There might be a caching issue. Try clearing the cache or disable cache temporarily to see if that resolves the issue. You can use the “Purge Cache” feature in the Cloudflare dashboard under the Caching tab.

5. Worker Script Errors.
Although the script works in the debugger, there might be runtime errors when deployed. Check the Worker logs for any errors. You can do this in the Cloudflare dashboard under the Workers tab by clicking on the "Logs" button.

6. Permissions and Settings.
Ensure that the Worker has the necessary permissions and settings enabled. Sometimes specific settings in the Worker script may need to be adjusted depending on the traffic and request types.

https://developers.cloudflare.com/workers/

If you have followed these steps and the issue persists, please provide any error messages or logs, and I will be happy to assist you further.

Best regards,
Szymon Kamiński
Cloudflare Support