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.

How to use pixi.js-legacy and verify that it has been activated?

See original GitHub issue

Hello, this is not a bug report, but just a question on how to use pixi.js-legacy.

I would like to activate it in my word game, because player numbers have dropped after the upgrade to pixi.js v5 and some users complain about the “WebGL unsupported in this browser” error.

In my HTML-file I have added the CDN-link to pixi.js-legacy:

<SCRIPT TYPE="text/javascript" SRC="//cdn.jsdelivr.net/npm/pixi.js@5.2.1/dist/pixi.min.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="//cdn.jsdelivr.net/npm/pixi.js-legacy@5.2.1/dist/pixi-legacy.min.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="//cdn.jsdelivr.net/npm/pixi-filters@latest/dist/pixi-filters.js"></SCRIPT>

In my Javascript file I have the following code (without any imports at the top):

jQuery(document).ready(function($) {
        var app = new PIXI.Application({
                width: BOARD_WIDTH,
                height: BOARD_HEIGHT + SmallTile.HEIGHT,
                view: document.getElementById('board'),
                antialias: true,
                backgroundColor: 0xFFFFFF
        });

Thank you

Expected Behavior

The game is rendered in all browsers

Current Behavior

The game is not displayed for some users, with console error: WebGL unsupported in this browser

Possible Solution

Use pixi.js-legacy, but unclear how.

Steps to Reproduce

Environment

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
themoonratcommented, Dec 29, 2021

Correct. When dealing with these full pre-builds of pixijs on a cdn, use either the regular version OR the legacy version, but not both

1reaction
rubenlgcommented, Dec 28, 2021

@stla a bit late but hopefully this will help others landing here: you should only have one installed. pixi.js-legacy is a superset of pixi.js, including both WebGL and Canvas (in practice, installing the legacy one with npm automatically installs the other one, not sure what the minified versions do).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use pixi.js-legacy and verify that it has been activated?
Hello, this is not a bug report, but just a question on how to use pixi.js-legacy. I would like to activate it in...
Read more >
PIXI.settings - PixiJS API Documentation
1: Use the pixi.js-legacy package, which includes a Canvas renderer as a fallback in case high performance WebGL is not supported.
Read more >
"WebGL unsupported in this browser" when using webpack
My project is running: Typescript 3.4.5, Pixi.js 5.0.2, ... unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.
Read more >
PIXI.settings - PixiJS: Documentation
1: Use the pixi.js-legacy package, which includes a Canvas renderer as a fallback in case high performance WebGL is not supported.
Read more >
pixi.js-legacy - UNPKG
85, * If enabled is true the filter is applied, if false it will not. ... 2692, * option only is available when...
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