Skip to content

Bug: Cannot read property MAX_UNIFORM_BUFFER_BINDINGS of undefined for Chrome 64 #11458

@Vlad160

Description

@Vlad160

Current Behavior

According to the Pixi.js FAQ, it supports old browsers https://github.com/pixijs/pixijs/wiki/FAQs

However, it fails to initialize itself for Chrome 64 with the following issue

Image

Expected Behavior

No errors in the console, and the page is not blank.

Steps to Reproduce

I created a small example here https://github.com/Vlad160/pixi-js-chrome-64

Polyfills and Vite are already configured.

  1. Clone https://github.com/Vlad160/pixi-js-chrome-64
  2. npm i
  3. npm run build
  4. npm run preview

Environment

Possible Solution

This issue doesn’t appear in Pixi v7.

Some systems in Pixi.js depend on each other — for example, GlBufferSystem requires gl to be initialized by GlContextSystem. This means the context change hook of GlContextSystem must run before GlBufferSystem's hook.

System execution order is determined by .sort(). But before ES10, array sorting was unstable, so items with equal priority might be reordered — which is exactly what happens here.

I added console.log statements to Extensions.handleByNamedList, and here's what I found:

In Chrome 64:

Image

GlContextSystem runs after GlBufferSystem — incorrect.

In modern Firefox:

Image

The order is correct.

Fix
Manual stable sort implementation

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    env: webglIssue specific to WebGL-based renderingpriority: normalImportant but not blocking the next releasescope: renderingIssue related to the core renderer or rendering pipelines

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions