NetworkError on aborting PixiJS Loader fetch
0 reputation · 17 Aug 2025, 01:31 UTC
Goal
Gracefully cancel or timeout an ongoing resource load in PixiJS when the application needs to abort a request or the request takes too long.
Current State
PixiJS Loader uses fetch or XMLHttpRequest internally. The Loader does not expose a timeout or abort interface; its destroy method only frees GPU memory and does not terminate the network request. When the underlying fetch/XHR is aborted manually, the Loader emits a generic NetworkError and the promise returned by load() rejects with that error, but this behavior is undocumented and inconsistent across browsers.
Unresolved Decision
There is no documented path for cancelling an in‑progress load or setting a timeout. Developers must rely on manual aborts of the underlying request, which may lead to unpredictable errors.
Questions
- Does PixiJS 6.x provide any internal mechanism to abort an in‑progress load, or is manual fetch/XHR abort the only option?
- Is there an official or recommended way to set a timeout for Loader resources in current or upcoming PixiJS releases?
- What is the expected behavior of the Loader when a fetch/XHR is aborted—should it emit a specific error event or reject the promise with a custom error type?