question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading asset with same name, why is error thrown instead of invoking onError callback

See original GitHub issue

More of a question of intension or not and maybe an explanation of why.

When loading an asset twice with the same name the Loader.add method throws an error.

Expected Behavior

When loading an asset twice with the same name, the Loader.onError callback will be invoked

Current Behavior

When loading an asset twice with the same name the Loader.add method throws an error.

Possible Solution

Catch the error and invoke the onError callback

Steps to Reproduce

load an asset with the same name twice and note you cannot catch the error with the onError callback method.

Environment

N/A

  • pixi.js version: 5.3.7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bigtimebuddycommented, Jan 31, 2021

Loader holds on to resources after they have been loaded(in addition to the texture caches). Is okay to reset after you’re done loading to remove those references and load more.

0reactions
kamcknigcommented, Jan 31, 2021

I see, the _loader instance I’m using is the one that comes from new Application().loader. Is that still intended? That one should use reset afterward? Are the previous textures in that main loader instance then stored in the TextureCache?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loading asset with same name, why is error thrown instead of ...
load an asset with the same name twice and note you cannot catch the error with the onError callback method. Environment. N/A. pixi.js...
Read more >
flutter - why am I getting an error when calling my image asset ...
You must have and asset called exactly like the name you're printing in your Text. Check into de folder "assets/images/" for that names....
Read more >
How to Solve the Chunk Load Error in JavaScript - Rollbar
Whenever there's an error observed in dynamically fetching helper JavaScript files known as Chunks, a ChunkLoad Error is thrown.
Read more >
A Comprehensive Guide To Error Handling In Node.js
You can also throw it, which causes the Error object to become an exception. Once you throw an error, it bubbles up the...
Read more >
Advanced | Understand.io
In JavaScript you can throw any type of data that you'd like: ... the details of the error are not reported (to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found