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

Warn when there is a multiFile load failure #5851

Closed
wants to merge 3 commits into from

Conversation

ubershmekel
Copy link
Contributor

@ubershmekel ubershmekel commented Oct 2, 2021

I spent more than an hour debugging this. The animation wasn't working.
I eventually found that I was loading an invalid URL as an Aseprite texture.

This PR (delete as applicable)

  • Adds a new feature

Describe the changes below:

Warn when one file fails to load out of a multiFile. E.g. when a aseprite texture fails to load because of an invalid URL.

I spent more than an hour debugging this. The animation wasn't working.
I eventually found that I was loading an invalid URL as an Aseprite texture.
@samme
Copy link
Contributor

samme commented Oct 4, 2021

I think there are no arrow functions in Phaser 3.

@photonstorm
Copy link
Collaborator

You can't use ES6 in Phaser 3 I'm afraid.

Also, an invalid URL would clearly show up on the Dev Tools Network panel. The only time it wouldn't is if you did actually get the file, but it had invalid contents (then I would expect a runtime error from the parser tbh)

@ubershmekel
Copy link
Contributor Author

@photonstorm my case was a vite dev server. I was debugging an aseprite animation not loading and saw my JSON file loaded correctly in the network panel, but the JSON file was not in the cache so my anims was empty. Turns out the image URL resulted in an html file. Because I was loading an aseprite JSON+PNG multfile, I did not see a warning for why my JSON was not in the cache. I wasn't even looking for an image loading issue, but that's what wrecked my JSON loading.

I removed the arrow function in favor of a regular function.

@photonstorm
Copy link
Collaborator

I merged your PR locally and it will now print a console.warn for every MultiFile Phaser loads, even if it's successful, because if it loads say a PNG and a JSON, it'll warn after loading the PNG because isReadyToProcess() returns false for the first file. Sorry, as it stands, I cannot merge this.

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 this pull request may close these issues.

None yet

3 participants