Subject: Workers not applied
Customer's Ticket "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 Customer,
Thank you for reaching out to Cloudflare Support. I understand that you've added a Worker to your
site, and while it works in the debugger, it doesn't seem to be functioning when you query your site
directly. Let's troubleshoot this issue together.
Steps to Ensure Your Worker is Applied Correctly
- Worker Route Configuration:
-
Ensure that your Worker is correctly mapped to the appropriate route(s).
In the Cloudflare Dashboard, go to Workers > Manage Workers, and then check the routes specified for your Worker.
Make sure the URL pattern matches your site's URLs correctly.
- Script Activation:
-
Verify that the Worker script is active. Under the Workers tab, check that your script is
enabled. You should see a toggle switch next to your script's name; it should be in the "on"
position.
- Domain Configuration:
-
Double-check that your domain is correctly set up in Cloudflare. Sometimes issues arise if
the domain settings are not properly configured to use Cloudflare's proxy.
- Cache Issues:
-
Sometimes, old cached data might interfere with the application of new Workers. Clear your
site's cache in the Cloudflare Dashboard under Caching > Configuration > Purge
- Error Logs and Debugging:
-
Check the error logs for any issues that might be preventing your Worker from running as
expected. In the Workers tab, click on your Worker, and then go to Logs to review any
errors or warnings.
- Propagation Time:
-
Occasionally, it might take a few minutes for changes to propagate fully. If you have just
recently deployed your Worker, give it a little time and then check again.
Additional Tips
Service Bindings:
If your Worker relies on any Service Bindings (such as KV storage or Durable
Objects), ensure these are properly configured and accessible.
Firewall Rules:
Check if there are any firewall rules or security settings that might be blocking
the Worker requests. Go to Firewall > Firewall Rules to review and adjust accordingly.
If you've gone through these steps and your Worker still isn't functioning as expected, please
provide us with the following details so we can assist you further:
The specific route or URL pattern the Worker is supposed to be applied to.
Any error messages you are seeing in the logs.
A brief description of what the Worker script is intended to do.
We are here to help and ensure your Worker operates smoothly. Thank you for choosing Cloudflare.
Best regards,
Saber Moahmed
Cloudflare Support Team