Skip to content

Error: Object/factory with type CdbStore is not registered inside GetIt when navigating to second page in test #328

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

Closed
thiagosmagalhaes opened this issue May 23, 2023 · 8 comments

Comments

@thiagosmagalhaes
Copy link

I am encountering an error while running my test. The test involves registering a CdbStore in the GetIt service locator, loading the first page of a widget, and then navigating to a second page. Both pages access the CdbStore using .get(). However, when the second page is accessed during the test, I receive the following error: "Object/factory with type CdbStore is not registered inside GetIt."

Steps to reproduce:

Register CdbStore in the GetIt service locator.
Load the first page of the widget.
Navigate to the second page, which also accesses CdbStore using .get().
Expected behavior:
The CdbStore should be successfully retrieved from the GetIt service locator on both the first and second pages, without any errors.

Actual behavior:
When accessing the second page during the test, the error "Object/factory with type CdbStore is not registered inside GetIt" is thrown.

Additional information:

I have verified that the CdbStore is correctly registered in the GetIt service locator before running the test.
The error only occurs when accessing the second page during the test. The first page is able to retrieve the CdbStore without any issues.
The issue seems to be related to the test environment or navigation between pages, as the registration and retrieval of CdbStore work fine in the regular app flow.
Environment:

get_it version: 7.2
I would appreciate any assistance in resolving this issue. Thank you!

@thiagosmagalhaes
Copy link
Author

I tested it on version 7.6 but the problem remains

@escamoteur
Copy link
Collaborator

hmm difficult to pinpoint with that information. Could you create a small sample project that shows this behaviour?

@sunjoong85
Copy link

I have similar issues. Getit with Chrome works fine. But, iPhone and iOS emulator shows exactly same errors that you posted.

@escamoteur
Copy link
Collaborator

escamoteur commented Jun 3, 2023 via email

@escamoteur
Copy link
Collaborator

any news on this?

@leferrad
Copy link

I had the same error - working well with Chrome but having the error in Safari (iOS). Let me know what to provide to inspect better this error.

@escamoteur
Copy link
Collaborator

escamoteur commented Nov 18, 2024 via email

@leferrad
Copy link

Can you please create a minimal repro project so I can reproduce and debug? Am 18. Nov. 2024, 00:35 +0100 schrieb Leandro Ferrado @.>:

I had the same error - working well with Chrome but having the error in Safari (iOS). Let me know what to provide to inspect better this error. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.
>

I was creating a simple project to allow reproducing the error, but then it didn't happen - so after isolating everything on my actual app I figured the error happened in the GetIt call but because of another silent error. So dismiss my comment, this is not an issue with this package. Thanks for the response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants