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: MAX_TEXTURES constant #10545

Closed
vaga opened this issue May 18, 2024 · 2 comments · Fixed by #10558
Closed

Bug: MAX_TEXTURES constant #10545

vaga opened this issue May 18, 2024 · 2 comments · Fixed by #10558
Assignees

Comments

@vaga
Copy link

vaga commented May 18, 2024

Current Behavior

I have this error on my tests after upgrading to 8.1.4:

TypeError: canvas.getContext is not a function
 ❯ getTestContext ../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/getTestContext.ts:19:26
 ❯ maxRecommendedTextures ../node_modules/pixi.js/src/rendering/renderers/shared/texture/utils/maxRecommendedTextures.ts:12:16
 ❯ ../node_modules/pixi.js/src/rendering/batcher/shared/const.ts:3:29

Expected Behavior

Don't get an error when running node test with an import of pixi.js

Steps to Reproduce

Run a js file with node with an import of pixi.js

Environment

  • pixi.js version: 8.1.4

Possible Solution

MAX_TEXTURES is no more a constant. It depends of context.

Additional Information

No response

@bigtimebuddy
Copy link
Member

@GoodBoyDigital I think we need to defer the call for maxtexutures until it is used. Also, that function should handle non-gl environments gracefully.

@GoodBoyDigital
Copy link
Member

agree! was trying to avoid changing too much code...

@GoodBoyDigital GoodBoyDigital self-assigned this May 20, 2024
@GoodBoyDigital GoodBoyDigital linked a pull request May 20, 2024 that will close this issue
3 tasks
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

Successfully merging a pull request may close this issue.

3 participants