Skip to content

Commit 4f4bc1c

Browse files
fix: blank page when javascript is disabled (#1426)
Co-authored-by: Daniel Roe <daniel@roe.dev>
1 parent bda3037 commit 4f4bc1c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

nuxt.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ export default defineNuxtConfig({
227227

228228
htmlValidator: {
229229
enabled: !isCI || (provider !== 'vercel' && !!process.env.VALIDATE_HTML),
230+
options: {
231+
rules: { 'meta-refresh': 'off' },
232+
},
230233
failOnError: true,
231234
},
232235

server/plugins/fallback-ui.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default defineNitroPlugin(nitroApp => {
2+
if (import.meta.prerender) {
3+
nitroApp.hooks.hook('render:html', (html, { event }) => {
4+
if (event.path === '/200.html') {
5+
html.head.push('<noscript><meta http-equiv="refresh" content="1"></noscript>')
6+
}
7+
})
8+
}
9+
})

0 commit comments

Comments
 (0)