gpu.js
gpu.js copied to clipboard
Regression: new GPU() constructor fails in Chrome/Edge post v2.4.2
Hi GPU.js Team,
I've encountered an issue with the GPU constructor in recent versions when using Chrome or Edge, where new GPU(); throws "TypeError: GPU is not a constructor". This issue seems to be a more specific recurrence of problems discussed in the later comments of closed issue #490.
Key Finding: Through testing previous versions, I've determined that gpu.js v2.4.2 is the last version where new GPU(); works as expected directly in Chrome and Edge. Link to v2.4.2: https://unpkg.com/[email protected]/dist/gpu-browser.min.js
Behavior in Later Versions (2.4.3 up to latest): In Chrome/Edge, new GPU(); fails. The workarounds using new window.GPU.GPU() or the try-catch method (as suggested by @danielmihalcea in #490) is required for cross-browser compatibility. Firefox does not seem affected and new GPU(); continues to work.
Expected Behavior: The new GPU(); constructor should ideally work consistently across supported browsers as it did in v2.4.2 and earlier.
Actual Behavior (Post v2.4.2 in Chrome/Edge): Invoking const gpu = new GPU(); results in "Uncaught TypeError: GPU is not a constructor".
This specific version information (v2.4.2 as the turning point) might help in pinpointing the cause of this regression for non-Firefox browsers.
Thanks for your work on this library!