-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
[BUG] mobx won't generate types generated by other generators, and always putting InvalidType in place of the correct type. #926
Comments
Same issue here, on our case, it puts "InvalidType" instead of "AppLifecycleState" or "Size". |
Same issue here, with type |
@andrelrf1 @ulisseshen @Heatclift This is not a bug in mobx, but depending on your code, build_runner may not work. In my experience, I've had no problems using the libraries mentioned above. I can't help you without reproducible source code. See below to help you resolve the issue. https://github.com/dart-lang/build/blob/master/build_config/README.md#adjusting-builder-ordering |
For anyone coming across this issue who does not get the - relatively sparse - docs about adjusting the build order, add this to your build.yaml file: global_options:
json_serializable:json_serializable:
runs_before:
- mobx_codegen:mobx_generator Replace the reference to json_serialization with the package and builder you are using. |
@ulisseshen global_options:
flutter_gen_runner:
runs_before:
- mobx_codegen:mobx_generator |
Thanks guys, this really worked! Sorry for the delay in responding. |
I think we should make a guide for this on the website...can you please make a short PR for this ? 💯 |
I am with the same issue using drift. The command to generate the code "dart run build_runner build --delete-conflicting-outputs --verbose". I am following the links / advices on this page issue but no success. One of my attemps was create a file build.xml :
But same problem. |
I started to make a desktop flutter application that needs to access data from a sqlite database with drift, but while doing state management with mobx I realized that the type generated by drift was never recognized by mobx, where instead of the correct type was placed InvalidType. This can be fixed manually, just by replacing the type in the generated file, but as the application grows it is becoming unfeasible to make these changes, because every time we run build_runner the automatically generated files are updated and all changes made manually are lost. Is there any solution to this?
The text was updated successfully, but these errors were encountered: