diff --git a/src/runtime/browser/global.ts b/src/runtime/browser/global.ts index 3e36e614..8f9f21b5 100644 --- a/src/runtime/browser/global.ts +++ b/src/runtime/browser/global.ts @@ -1,9 +1,10 @@ /* eslint-disable no-restricted-globals */ function getGlobal() { + if (typeof globalThis !== 'undefined') return globalThis if (typeof self !== 'undefined') return self if (typeof window !== 'undefined') return window throw new Error('unable to locate global object') } -export default globalThis || getGlobal() +export default getGlobal()