You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
History may require some tweaking because it is silencing regular 404 when importing .js files for instance.
Here for instance someone may mistype an import name https://github.com/jamiealex/vite-history-fallback/blob/master/App.vue#L7
And instead of returning of 404, letting the dev know he messed up it is giving the index.html.
Chrome is throwing an error here: Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec. but it could be more explicit IMO.
I know this could be handled by eslint/third party dev tools but I genuinly think we should not rely on that. To know whether the response should fallback we could maybe check for ?import query string or other metadata.
I actually found a Chrome Bug where Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec. is sometimes not thrown.... thus my issue ...
Describe the bug
History may require some tweaking because it is silencing regular 404 when importing .js files for instance.
Here for instance someone may mistype an import name https://github.com/jamiealex/vite-history-fallback/blob/master/App.vue#L7
And instead of returning of 404, letting the dev know he messed up it is giving the index.html.
Chrome is throwing an error here:
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
but it could be more explicit IMO.I know this could be handled by eslint/third party dev tools but I genuinly think we should not rely on that. To know whether the response should fallback we could maybe check for
?import
query string or other metadata.Reproduction
https://github.com/jamiealex/vite-history-fallback
The text was updated successfully, but these errors were encountered: