Netlify.toml redirects stopped working overnight + MIME error

Hey everyone,

So I was working on my project over at wildtrack.project-unknown.dev and noticed that the login page no longer works. When looking at the logs it looks like the netlify.toml file that I’ve been using for a few months now has just stopped working. The contents look like this:

[[redirects]]
from = “/api/*”
to = “https://linkto.myapi.com/api/:splat
status = 301
force = true

This redirect powers the login I have and has stopped working. Another thing I noticed is an error in the console on the live site:
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.

I would usually chalk this down to a problem with the code I deployed but this issue persists even when clearing cache and building an old production where the login worked. I have tried different browsers and clearing browser cache to no avail!
I’m very lost and unsure what to do first.

Thanks!

If you are proxying to an external API use a 200 status code, not a 301 as noted in this documentation.

If a text/html response is still returned this is an issue with the endpoint, not the rewrite itself.