Skip to content

Scene.initializeStaticResources() swallows load failures and surfaces a misleading downstream error #244

Description

@bdero

When loadBaseShaderLibrary() or Material.initializeStaticResources() fails, Scene.initializeStaticResources() logs the error through dart:developer log() (not visible on web), resets the memoized future, and returns a future that completes normally (lib/src/scene.dart, ~lines 328-352). So awaiting it succeeds despite the failure, and the developer instead hits the baseShaderLibrary getter throwing 'The base shader bundle has not been loaded yet. Await Scene.initializeStaticResources()...', which points at the thing they already did and hides the real cause.

Fix: rethrow from initializeStaticResources() so an awaiting caller sees the failure, and/or retain the load error and rethrow it from the getter through a web-visible path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions