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