From a313f062612d04adec55e93696a8069e1965c152 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 9 Mar 2023 14:37:39 +0000 Subject: [PATCH] fix(nuxt): only log boot errors on client-side (#19553) --- packages/nuxt/src/app/nuxt.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nuxt/src/app/nuxt.ts b/packages/nuxt/src/app/nuxt.ts index 4ce8ca0f2e..8b904ab112 100644 --- a/packages/nuxt/src/app/nuxt.ts +++ b/packages/nuxt/src/app/nuxt.ts @@ -197,11 +197,11 @@ export function createNuxtApp (options: CreateOptions) { window.addEventListener('nuxt.preloadError', (event) => { nuxtApp.callHook('app:chunkError', { error: (event as Event & { payload: Error }).payload }) }) - } - // 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) }) + // 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) }) + } // Expose runtime config const runtimeConfig = process.server