Compare commits

..

2 Commits

Author SHA1 Message Date
Ryota Watanabe 83813f9cff
Merge cef5da6e1a into e644960794 2024-09-20 19:54:04 +07:00
wattanx cef5da6e1a fix: avoid throwing a 404 error before the middleware is executed 2024-09-18 22:16:29 +09:00
1 changed files with 0 additions and 13 deletions

View File

@ -244,19 +244,6 @@ const plugin: Plugin<{ router: Router }> = defineNuxtPlugin({
await nuxtApp.callHook('page:loading:end')
})
router.afterEach(async (to, _from) => {
if (to.matched.length === 0) {
await nuxtApp.runWithContext(() => showError(createError({
statusCode: 404,
fatal: false,
statusMessage: `Page not found: ${to.fullPath}`,
data: {
path: to.fullPath,
},
})))
}
})
nuxtApp.hooks.hookOnce('app:created', async () => {
try {
// #4920, #4982