gl-react icon indicating copy to clipboard operation
gl-react copied to clipboard

ReferenceError: Can't find variable: global

Open EvilTrev opened this issue 1 year ago • 1 comments

typedarray-pool attempts to use the global object here:

//Legacy pool support
if(!global.__TYPEDARRAY_POOL) {
  global.__TYPEDARRAY_POOL = {
.......
  }
}

I'm running TypeScript tsx files with vite. The code is little more than the HelloGL example at this point. Thoughts? It looks like typed array pool should probably be using globalThis, or a more elaborate section of code (like the one shown here: https://github.com/stephenh/ts-proto/issues/70#issuecomment-1638145123).

library version

├─┬ [email protected]
│ └── [email protected] deduped
└── [email protected]

EvilTrev avatar Mar 06 '24 08:03 EvilTrev

For now I'm inserting a small script that sets global = {} in my index.html as a workaround.

EvilTrev avatar Mar 06 '24 08:03 EvilTrev