-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
DataTextureLoader: fix promise never rejected on error #26412
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
If we call "onError" we should be passing an error in. In my opinion the the |
It’s important that promises aren’t left completely unresolved, which this PR achieves. To get correct error messages would require updating everything that extends DataTextureLoader, making it harder to review and reducing the chances that this PR gets merged. |
I'm suggesting that this PR is not using the |
Agreed. Ideally
AFAICS, updating just |
However, as a temporary solution this PR is fine imo. Maybe we can add a // TODO: Use try/catch and throw errors in derived loaders |
Added a comment as suggested: b2fea48 |
Related issue: None
Description
When using something that extends
DataTextureLoader
(egRGBELoader
) if it fails to parse the file then the.load()
error callback is never called, and the.loadAsync()
promise is never rejected.This is especially important when preloading assets for games etc, if the promise never succeeds or fails it gets stuck loading forever.