Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History fallback silencing 404 #193

Closed
AlexandreBonaventure opened this issue May 19, 2020 · 1 comment
Closed

History fallback silencing 404 #193

AlexandreBonaventure opened this issue May 19, 2020 · 1 comment

Comments

@AlexandreBonaventure
Copy link
Contributor

AlexandreBonaventure commented May 19, 2020

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

@AlexandreBonaventure
Copy link
Contributor Author

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 ...

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant