-
-
Notifications
You must be signed in to change notification settings - Fork 153
[BUG] Wrong work of get_it in release/profile mode flutter web #245
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
Comments
@escamoteur This problem is connected somehow to the way it is used. In case I pass GetIt.instance as an injected dependency (via constructor to my custom ServiceLocator class as example) - it emits this error. In case I use it as static GetIt.instance instead of an injected dependency - it works fine on web. |
Hi, I created a simple project that reproduces the same issue for me (HERE: https://github.com/HKop/getit-issue) It started happening once we extracted some of the files to a "lib_common" library and wanted to use them in the main app. Project structure:
Note: Issue is only present on web in release or profile mode.
When opening the console, the same error is shown, yet works properly in debug mode. |
This helps a lot
@kevmoo
Am 2. Feb. 2022, 22:16 +0100 schrieb HKop ***@***.***>:
… Hi, I created a simple project that reproduces the same issue for me (HERE: https://github.com/HKop/getit-issue) It started happening once we extracted some of the files to a "lib_common" library and wanted to use them in the main app.
Project structure:
1. getIt_issue main project.
2. lib_common library in getIt_issue folder that has components used in the main project.
Note: Issue is only present on web in release or profile mode.
1. To generate getIt files - "flutter packages pub run build_runner build --delete-conflicting-outputs" in the root getIt_issue folder;
2. Then to run the app on web in profile mode - "flutter run --profile -d chrome --dart-define=Dart2jsOptimization=O0"
When opening the console, the same error is shown, yet works properly in debug mode.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
duplicate of #238 |
Uh oh!
There was an error while loading. Please reload this page.
Having such issue in my main project. I see no idea how to fix it and it looks like get_it issue.
Code works fine if it runs in debug mode but as soon as we run it in profile or production - it simply crashes.
I found other people who have same issues with get_it so probably it is critical. Thanks for help!
Minimum reproducible code: https://github.com/bohdan1krokhmaliuk/get_it_issue.git
To reproduce:
The text was updated successfully, but these errors were encountered: