For Workes & Pages, what is the name of the domain?
What is the error number?
Loading module from “https://personal-website-5lm.pages.dev/src/lib/chatbot_utils.ts” was blocked because of a disallowed MIME type (“text/html”).
What is the error message?
Loading module from “https://personal-website-5lm.pages.dev/src/lib/chatbot_utils.ts” was blocked because of a disallowed MIME type (“text/html”).
What is the issue or error you’re encountering
I am encountering a disallowed MIME error when deploying or building my Astro page. When I check the network tab on my devtools it is actually a 404 not found error. So it seems that it is not finding the correct path after building the app. However, it works on astro dev mode.
What steps have you taken to resolve the issue?
I have updated astro, cloudflare, nodejs and wrangler on my machine.
I have tried to set crossorigin in the script.
I set the pretender option to false in the component.
Changing the paths to relative paths.
Try to use the /_astro/ path.
Try to change the “pages_build_output_dir” in wrangler.toml
Try to add an env variable specifying the node version in wrangler.toml
What are the steps to reproduce the issue?
This is the code that is causing the problem in my Astro component:
It finds the paths ./src/lib/* in dev mode but not in production when deploying it to Cloudflare pages. Or when building the app with Wrangler.
Note that “chatbot_utils” and “dom-selector” are typescript modules.