Skip to content

Commit

Permalink
fix: prevent a javascript error on the server side (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsulpis authored May 6, 2024
1 parent 05d99b3 commit 171b636
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WebGPURenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const STORAGE_REGEX = /var\s*<\s*storage[^>]+>\s*(\w+)/g
*/
const WORKGROUP_REGEX = /@workgroup_size\s*\(([^)]+)\)/

const _adapter = typeof navigator !== 'undefined' && (await navigator.gpu?.requestAdapter())
const _adapter = typeof navigator !== 'undefined' ? (await navigator.gpu?.requestAdapter()) : null;
const _device = await (_adapter as GPUAdapter | null)?.requestDevice()

/**
Expand Down

0 comments on commit 171b636

Please sign in to comment.