-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Nuxt 3 broken error page handling on direct URL call #4
Comments
can confirm. Just stumbled upon this one myself. I've solved it this way to exclude nuxt internal import { useCompression } from 'h3-compression'
export default defineNitroPlugin((nitro) => {
nitro.hooks.hook('render:response', async (response, { event }) => {
if (response.headers?.['content-type'].startsWith('text/html') && !event?.context?.matchedRoute?.path.startsWith('/__nuxt')) {
await useCompression(event, response)
}
})
}) |
Same problem here. @bernhardberger solution helped, but seems like that kind of check should already be included into plugin itself |
@LeTraceurSnork I am goind to update the readme soon. At the end it's not a plugin (yet) 😉 |
|
@entropin This questions beats me. I dont know, but it looks good for me. |
Environment
Darwin
v20.9.0
3.8.2
3.10.0
2.8.1
[email protected]
-
devtools
-
-
Reproduction
https://stackblitz.com/edit/github-k9tmde?file=README.md
Describe the bug
The error page in Nuxt 3 stops working with this plugin enabled. A normal invalid NuxtLink is working, but if you call something not existing manually from e.g. the browser bar. The 404 error is not handled by Nuxt anymore.
After removing the server plugin compression.ts this is working again.
Additional context
I have linked a minimal demo on StackBlitz, but I had to download the project and use it locally to get the error. It could be related to how StackBlitz is handling the localhost URLs.
Logs
No response
The text was updated successfully, but these errors were encountered: