Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Cannot read property 'getExtension' of undefined #10325

Open
LiFengONE opened this issue Mar 14, 2024 · 0 comments
Open

Bug: Cannot read property 'getExtension' of undefined #10325

LiFengONE opened this issue Mar 14, 2024 · 0 comments

Comments

@LiFengONE
Copy link

Current Behavior

I get this error when useing "pixi.js-legacy": "7.3.3".
TypeError Cannot read property 'getExtension' of undefined
error stack:

let storedGl: WebGLRenderingContext;
let extensions: Partial<CompressedTextureExtensions>;

function getCompressedTextureExtensions()
{
    extensions = {
        s3tc: storedGl.getExtension('WEBGL_compressed_texture_s3tc'),
        s3tc_sRGB: storedGl.getExtension('WEBGL_compressed_texture_s3tc_srgb'), /* eslint-disable-line camelcase */
        etc: storedGl.getExtension('WEBGL_compressed_texture_etc'),
        etc1: storedGl.getExtension('WEBGL_compressed_texture_etc1'),
        pvrtc: storedGl.getExtension('WEBGL_compressed_texture_pvrtc')
            || storedGl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),
        atc: storedGl.getExtension('WEBGL_compressed_texture_atc'),

bug in detectCompressedTextures
function detection.test return false, but storedGl still is undefined, run detection.remove get this error.

for (const detection of options.detections)
        {
            if (options.skipDetections || await detection.test())
            {
                formats = await detection.add(formats);
            }
            else if (!options.skipDetections)
            {
                formats = await detection.remove(formats);
            }
        }

Expected Behavior

How can I fix this issue with current pixi version, or change another v7 version?

Steps to Reproduce

For low version Android device (version <= 6.0), we use forceCanvas to fallback canvas render, like this.

this.app = new PIXI.Application({
      backgroundAlpha: 0,
      width: this.width,
      height: this.height,
      autoDensity: true,
      forceCanvas: shouldFallbackCanvas
});

Environment

  • pixi.js-legacy version: v7.3.3
  • Browser & Version: most of Android 5.1
  • OS & Version: any

Possible Solution

No response

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant