You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to catch spine loading error if an image, defined in .atlas file, has failed to load (network error, absence of asset itself, etc.).
Dependencies:
spine: 4.1.24
pixi-spine: 4.0.4
pixi.js: 7.3.2
Example
Few assumptions first: assets folder is available and serve files correctly. faultySpine consists of 3 files: faultySpine.json, faultySpine.atlas and faultySpine.png.
To prevent faultySpine.png file from being loaded - it has been blocked, through Chrome Dev Tools.
If const texture = await loader.load<Texture>({ src: url, data: imageMetadata }); will throw an error -textureLoadedCallback will never be called, therefore the following rejection will never happen in this case, thus error will never be captured and will be an instance of Uncaught error:
if (!newAtlas) {
reject('Something went terribly wrong loading a spine .atlas file\nMost likely your texture failed to load.');
}
Hi!
Problem
It is not possible to catch spine loading error if an image, defined in
.atlas
file, has failed to load (network error, absence of asset itself, etc.).Dependencies:
Example
Few assumptions first:
assets
folder is available and serve files correctly.faultySpine
consists of 3 files:faultySpine.json
,faultySpine.atlas
andfaultySpine.png
.To prevent
faultySpine.png
file from being loaded - it has been blocked, through Chrome Dev Tools.Here is the code example, itself:
Trying to figure out why an error for
Assets.load('faultySpine.json')
has not been trigged, brought up the following part to attention:https://github.com/pixijs/spine/blob/master/packages/loader-base/src/atlasLoader.ts#L98-L108
If
const texture = await loader.load<Texture>({ src: url, data: imageMetadata });
will throw an error -textureLoadedCallback
will never be called, therefore the following rejection will never happen in this case, thus error will never be captured and will be an instance ofUncaught error
:https://github.com/pixijs/spine/blob/master/packages/loader-base/src/atlasLoader.ts#L59-L61
Solution (?)
Call
textureLoadedCallback
withnull
, if texture loading has failed, to prevent TextureAtlas setup and trigger an error that will be captured in (1)The text was updated successfully, but these errors were encountered: