File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/nuxt/src/app/plugins Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { defineNuxtPlugin } from '../nuxt'
7
7
import { devLogs , devRootDir } from '#build/nuxt.config.mjs'
8
8
9
9
export default defineNuxtPlugin ( ( nuxtApp ) => {
10
+ if ( ! import . meta. client || import . meta. test ) { return }
11
+
10
12
// Show things in console
11
13
if ( devLogs !== 'silent' ) {
12
14
const logger = createConsola ( {
@@ -41,7 +43,7 @@ export default defineNuxtPlugin((nuxtApp) => {
41
43
42
44
// pass SSR logs after hydration
43
45
nuxtApp . hooks . hook ( 'app:suspense:resolve' , async ( ) => {
44
- if ( window && window . __NUXT_LOGS__ ) {
46
+ if ( typeof window !== 'undefined' && window . __NUXT_LOGS__ ) {
45
47
await nuxtApp . hooks . callHook ( 'dev:ssr-logs' , window . __NUXT_LOGS__ )
46
48
}
47
49
} )
You can’t perform that action at this time.
0 commit comments