Coder Social home page Coder Social logo

[BUG] mobx won't generate types generated by other generators, and always putting InvalidType in place of the correct type. about mobx.dart HOT 8 CLOSED

andrelrf1 avatar andrelrf1 commented on June 18, 2024 6
[BUG] mobx won't generate types generated by other generators, and always putting InvalidType in place of the correct type.

from mobx.dart.

Comments (8)

amondnet avatar amondnet commented on June 18, 2024 1

@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
dart-lang/build#2701
trevorwang/retrofit.dart#578

from mobx.dart.

TobiasPrt avatar TobiasPrt commented on June 18, 2024 1

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.

from mobx.dart.

Heatclift avatar Heatclift commented on June 18, 2024

Same issue here, on our case, it puts "InvalidType" instead of "AppLifecycleState" or "Size".

from mobx.dart.

amondnet avatar amondnet commented on June 18, 2024

dart-lang/build#2701

from mobx.dart.

ulisseshen avatar ulisseshen commented on June 18, 2024

Same issue here, with type AppLocalizations from the package I10n import 'package:flutter_gen/gen_l10n/app_localizations.dart';

from mobx.dart.

amondnet avatar amondnet commented on June 18, 2024

@ulisseshen
https://github.com/FlutterGen/flutter_gen/blob/main/packages/runner/build.yaml

global_options:
  flutter_gen_runner:
    runs_before:
      - mobx_codegen:mobx_generator

from mobx.dart.

andrelrf1 avatar andrelrf1 commented on June 18, 2024

Thanks guys, this really worked! Sorry for the delay in responding.

from mobx.dart.

pavanpodila avatar pavanpodila commented on June 18, 2024

I think we should make a guide for this on the website...can you please make a short PR for this ? 💯

from mobx.dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.