Worker to copy one subdomain to another
This is my current worker that is supposed to get everything from
stats.mydomain.com/status/server
and push it to status.mydomain.com
. However, I get this error: Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
How do I fix this?
5 Replies
Where are you seeing that? When you access the server or in the wrangler logs? That looks like you’re attempting to return some script but the headers are misconfigured so it is attempting to return as html
In the console using inspect element
When I go and get the callbacks from cloudflare, it all returns code 200 (ok)
Everything appears to be in order
Are you using quick edit to develop the worker?
Yes
My guess is that it is a quick dev bug and not an issue with your worker