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] Image assets are not loaded #9

Open
fadri1 opened this issue Dec 15, 2023 · 1 comment
Open

[Bug] Image assets are not loaded #9

fadri1 opened this issue Dec 15, 2023 · 1 comment

Comments

@fadri1
Copy link

fadri1 commented Dec 15, 2023

When loading an image asset, I get this error : Unrecognized source type to auto-detect Resource

After investigation, the error happened during the texture creation here:

const texture = Texture.from(canvas, {

The method autoDetectResource from @pixi/core used NodeCanvasResource.test here: https://github.com/pixijs/pixijs/blob/0238708e11d4842787e9144fad33479ff12cbe89/packages/core/src/textures/resources/autoDetectResource.ts#L114C13-L114C13

I don't understand why source instanceof NodeCanvasElement returns false as source seems to be a NodeCanvasElement instance. As a temporary workaround, I override NodeCanvasResource.test static method.

I work on a project which have to run on Node and browser, and I updated pixi.js to 7.3.2, so @pixi/node loads packages as @pixi/core, @pixi/assets, etc at version 7.3.2.

The problem is probably related to this, is there any plan to update this library at 7.3.2, or at 8.0.0?

@vgw-bzc
Copy link

vgw-bzc commented May 24, 2024

I'm getting this same problem still. When importing anything from @pixi/node it overrides the INSTALLED resources so that when I do Sprite.from(...) it errors because the INSTALLED list has been overridden.

Using Sprite from @pixi/node doesn't seem to help either so I'm not sure how to proceed.

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

2 participants