mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 15:50:32 +00:00
fix(nuxt): suppress handled errors (#20002)
This commit is contained in:
parent
434e2013e4
commit
4ed5d2f872
@ -37,6 +37,7 @@ onErrorCaptured((err, target, info) => {
|
||||
if (process.server || (isNuxtError(err) && (err.fatal || err.unhandled))) {
|
||||
const p = callWithNuxt(nuxtApp, showError, [err])
|
||||
onServerPrefetch(() => p)
|
||||
return false // suppress error from breaking render
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -238,8 +238,9 @@ export function createNuxtApp (options: CreateOptions) {
|
||||
})
|
||||
|
||||
// Log errors captured when running plugins, in the `app:created` and `app:beforeMount` hooks
|
||||
// as well as when mounting the app and in the `app:mounted` hook
|
||||
nuxtApp.hook('app:error', (...args) => { console.error('[nuxt] error caught during app initialization', ...args) })
|
||||
// as well as when mounting the app.
|
||||
const unreg = nuxtApp.hook('app:error', (...args) => { console.error('[nuxt] error caught during app initialization', ...args) })
|
||||
nuxtApp.hook('app:mounted', unreg)
|
||||
}
|
||||
|
||||
// Expose runtime config
|
||||
|
Loading…
Reference in New Issue
Block a user