Skip to content

Commit 44cf62a

Browse files
committed
fix #331: check if window exists
1 parent 963bf94 commit 44cf62a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/xr/src/store.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ function startEmulate(emulate: EmulatorType | true, alert: boolean) {
277277
export function createXRStore<T extends XRElementImplementations>(options?: XRStoreOptions<T>): XRStore<T> {
278278
const emulate = options?.emulate ?? 'metaQuest3'
279279
let cleanupEmulate: (() => void) | undefined
280-
if (emulate != false) {
280+
if (typeof window !== 'undefined' && emulate != false) {
281281
if (window.location.hostname === 'localhost') {
282282
startEmulate(emulate, false)
283283
}

0 commit comments

Comments
 (0)