pixi-viewport icon indicating copy to clipboard operation
pixi-viewport copied to clipboard

Does not work with @pixi/webworker

Open scott-cornwell opened this issue 1 year ago • 4 comments

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

scott-cornwell avatar Apr 24 '23 14:04 scott-cornwell

Additionally, the InputManager being initialized in a webworker crashes.

scott-cornwell avatar Apr 24 '23 16:04 scott-cornwell

@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

polimorficzny avatar May 29 '23 09:05 polimorficzny

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 avatar Apr 14 '24 23:04 robin-rpr

@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.

scott-cornwell avatar Apr 15 '24 12:04 scott-cornwell