-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Annoying json_serializable bug #29
Comments
Without having some code to reproduce the error I cannot help you A quick check though: |
This is the annoying part, freezed.dart is being generated, and it have the
expected @JsonSerializable() annotations.
I try to dig deeper, but i couldn't reproduce it into a new project
(because it works).
…On Thu, 13 Feb 2020, 00:27 Remi Rousselet, ***@***.***> wrote:
Without having some code to reproduce the error I cannot help you
A quick check though:
Freezed doesn't generate .g.dart but .freezed.dart.
Did you use the right part?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#29?email_source=notifications&email_token=AJAO2XKPN3TRRZWD52VODELRCS43LA5CNFSM4KUIL7O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELTIEOI#issuecomment-585531961>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJAO2XIP274SID26S7CRDLLRCS43LANCNFSM4KUIL7OQ>
.
|
It may have something to do with the package versions. build_runner didn't support having a generator outputting dart code for another generator until last week. |
tried to force a version on build_runner, is not that. build_runner dont send any error feedback when generating stuffs.
I just used your example: part 'aaa.freezed.dart'; @immutable factory Model.fromJson(Map<String, dynamic> json) => _$ModelFromJson(json); and still not generating .g.dart. |
I see that you're using mobx_codegen. What happens if you remove it? |
Also, could you try adding the following file at the root of your project? # build.yaml
targets:
$default:
builders:
freezed|freezed:
enabled: false
builders:
freezed:
import: "package:freezed/builder.dart"
builder_factories: ["freezed"]
build_extensions: { ".dart": [".freezed.dart"] }
auto_apply: dependents
build_to: source
runs_before:
- json_serializable|json_serializable
- source_gen|combining_builder |
after this build yaml .freezed.dart stopped get generated too. but this can be a clue because I have a build.yaml for json_serializable. |
I am having the same issue Edit: never mind, I just ran pub upgrade and it worked |
Already tried to comment all dependences that could generate stuffs.. So far no good =/ Next test: comment ALL dependences of project and see if it will generate. |
Sadly I can't do much to help here. Consider uploading your |
It worked!!! Just deleted pubspec.lock, I guess build_runner was with an old version, even forcing it on pubspec. Tks so much! |
None of the above worked for me. This fixed it: A note which I found in the Freezed readme:
My Hope this helps anyone. |
On my production project freezed is not generating g.dart file, the problem is that I could not reproduce this bug on a test project.
Creating a test project everything works fine, copying the working fine class of test to production and the .g.dart is not generated.
I tried do add all pubspec dependencies of production project at test project, and test still working.
json_serializable classes is working well when not generated by freezed.
I dont know what to do to find this bug, any idea?
The text was updated successfully, but these errors were encountered: