Skip to content

Commit 0075f1b

Browse files
committed
docs: add example fixing Nuxt error page rendering
Related: nitrojs/nitro#1007 nuxt/nuxt#27269
1 parent d70fe37 commit 0075f1b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ import { useCompression } from 'h3-compression'
7373

7474
export default defineNitroPlugin((nitro) => {
7575
nitro.hooks.hook('render:response', async (response, { event }) => {
76+
// Skip internal nuxt routes (e.g. error page)
77+
if (getRequestURL(event).pathname.startsWith('/__nuxt'))
78+
return
79+
7680
if (!response.headers?.['content-type']?.startsWith('text/html'))
7781
return
7882

0 commit comments

Comments
 (0)