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
allReady is a convenient way to ensure all dependencies are fully initialised. But I found it only works for root scope?
When I pushed a new scope, registered a few async singleton (UserBookRepository in example) in it, and trying to call allReady, I got an error.
I'm asking here is because the error message is very confusing, as I'm calling allReady to wait before every instance is ready. But here it complains I'm accessing an instance before it is ready? Is it kind of against the idea of allReady or I misunderstood something?
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Builder:
You tried to access an instance of UserBookRepository that is not ready yet
'package:get_it[/get_it_impl.dart]()':
package:get_it/get_it_impl.dart:1
Failed assertion: line 404 pos 9: 'instanceFactory.isReady'
The text was updated successfully, but these errors were encountered:
Hi @escamoteur I failed to reproduce the bug in the UT, as all the tests are green.
And I kind of worked around the issue in the app, but still not 100% sure how and why.
I'll close the issue, unless I found more useful details
Uh oh!
There was an error while loading. Please reload this page.
allReady
is a convenient way to ensure all dependencies are fully initialised. But I found it only works for root scope?When I pushed a new scope, registered a few async singleton (
UserBookRepository
in example) in it, and trying to callallReady
, I got an error.I'm asking here is because the error message is very confusing, as I'm calling
allReady
to wait before every instance is ready. But here it complains I'm accessing an instance before it is ready? Is it kind of against the idea ofallReady
or I misunderstood something?The text was updated successfully, but these errors were encountered: