gre / gl-react

gl-react – React library to write and compose WebGL shaders
https://gl-react-cookbook.surge.sh
MIT License
2.93k stars 163 forks source link

ReferenceError: Can't find variable: global #442

Open EvilTrev opened 6 months ago

EvilTrev commented 6 months ago

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

├─┬ gl-react-dom@5.2.1
│ └── gl-react@5.2.0 deduped
└── gl-react@5.2.0
EvilTrev commented 6 months ago

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