Prerender static 404 page
Is there any way to prerender a static 404 page instead of it being an SPA fallback in Nuxt 3?
error.vue file in the root of your Nuxt project. This file will serve as your custom error page, including 404 errors Docs > Guide > Directory-structure > error.vue (https://nuxt.com/docs/guide/directory-structure/error).nuxt.config.ts file, add the following configuration to enable prerendering of the error page:/404.html page during the build process Docs > Guide > Concepts > Rendering Modes > Universal Rendering Part 5 (https://nuxt.com/docs/guide/concepts/rendering#universal-rendering)./404.html file for any 404 errors. This step may vary depending on your hosting service.error.vue/404.html/404.htmlexport default defineNuxtConfig({
hooks: {
'prerender:routes' ({ routes }) {
routes.add('/404.html')
}
},
})