diff --git a/src/async.ts b/src/async.ts index e5f67399..28efc17f 100644 --- a/src/async.ts +++ b/src/async.ts @@ -44,7 +44,7 @@ export const useAsync = ( !_ref.value || (process.env.NODE_ENV === 'development' && process.client && - window[globalNuxt].context.isHMR) + window[globalNuxt]?.context.isHMR) ) { const p = cb() diff --git a/src/ssr-ref.ts b/src/ssr-ref.ts index 1b9dbe3a..4ca793cd 100644 --- a/src/ssr-ref.ts +++ b/src/ssr-ref.ts @@ -50,7 +50,7 @@ export const ssrRef = (value: T | (() => T), key?: string): Ref => { if (process.client) { if ( process.env.NODE_ENV === 'development' && - window[globalNuxt].context.isHMR + window[globalNuxt]?.context.isHMR ) { return ref(getValue(value)) } @@ -128,7 +128,7 @@ export const shallowSsrRef = ( if (process.client) { if ( process.env.NODE_ENV === 'development' && - window[globalNuxt].context.isHMR + window[globalNuxt]?.context.isHMR ) { return shallowRef(getValue(value)) }