davidfig/pixi-viewport

Does not work with @pixi/webworker

Opened this issue · 4 comments

pixi-viewport tires to access the window object which fails when running new Pixi 7 in a webworker

Additionally, the InputManager being initialized in a webworker crashes.

@scott-cornwell The same problem on my side, when tried to run inside web worker:

window is not defined at pixi_viewport.js:1307:1

Web worker run in an isolated environment that cannot access the DOM. This is not a bug but a limitation of Web Workers.

@robin-rpr I'm aware of that, but it's possible to refactor it so it does not depend on window. I have done this locally and I now have it working. So it is a bug that could be fixed.