question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pixi should support OffscreenCanvas Web Worker environments and other "headless" environments.

See original GitHub issue

I’m trying to use Pixi.js in a webworker with the OffscreenCanvas reference API It fails at runtime with a window undefined error.

Screen Shot 2021-01-02 at 4 47 58 PM

I am aware of the other Github issues that explain how Pixi does not want to support Node.js (etc) environments because the Pixi team feels Pixi is a browser only tool and don’t want to write isomorphic code but, WebWorker is a browser enviroment. I even tried to use the recommended pixi-shim and it failed expecting a window object as well (lol):

Screen Shot 2021-01-02 at 6 35 48 PM

OffscreenCanvas Web worker environments are a “browser environment” so what are Pixis plan to support this enviroment?

Other WebGL rendering libraries like Regl support this pattern by accepting a reference to a WebGL context passed directly to the initialization code. I am making assumptions here but feels like PIXI could follow that pattern?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

14reactions
Zyiecommented, Jan 14, 2021

hey @arbaaz yes progress is still being made, just slower than I would have liked.

I currently have pixi working inside a webworker using OffscreenCanvas. Here’s a little demo http://worker.goodboydigital.com/test/

I’ll be testing node support soon

13reactions
mmmolicommented, Sep 7, 2021

hey @arbaaz yes progress is still being made, just slower than I would have liked.

I currently have pixi working inside a webworker using OffscreenCanvas. Here’s a little demo http://worker.goodboydigital.com/test/

I’ll be testing node support soon

Please don’t go stale. I’m desperate to check out how you’ve done this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pixi should support OffscreenCanvas Web Worker ... - GitHub
I'm trying to use Pixi.js in a webworker with the OffscreenCanvas reference API It fails at runtime with a window undefined error.
Read more >
Pixi should support OffscreenCanvas Web Worker ...
Pixi should support OffscreenCanvas Web Worker environments and other "headless" environments.
Read more >
How to use PixiJS in web worker - Stack Overflow
pixi team is working on adding headless environments support like web workers; see https://github.com/pixijs/pixijs/issues/7123.
Read more >
Improve Graphics Performance with OffscreenCanvas & Web ...
In this tutorial, we'll examine how OffScreenCanvas and Web Workers can help us improve canvas performance. What is Web Workers API. Web workers...
Read more >
Diff - 3e8074275a..156777beda - chromium/src - Git at Google
The worker capacity must be + // incremented if this returns true. ... This may use environment // variables such as %LOCALAPPDATA%, %SYSTEMROOT%,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found