Skip to content
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

Invalid generated code "Error: Expected ')' before this." #1462

Open
itsJoKr opened this issue Dec 4, 2024 · 4 comments
Open

Invalid generated code "Error: Expected ')' before this." #1462

itsJoKr opened this issue Dec 4, 2024 · 4 comments

Comments

@itsJoKr
Copy link

itsJoKr commented Dec 4, 2024

It seems that a recent change in the generated code was a change from writeNotNull to records.

Image

But this change results in an error:

get_generated_doc_report_urls_api.g.dart:19:41: Error: Expected ')' before this.
@kevmoo
Copy link
Collaborator

kevmoo commented Dec 4, 2024

What version of Dart do you have? this is generating using new language features.

@itsJoKr
Copy link
Author

itsJoKr commented Dec 4, 2024

It's a little bit complex workflow as this is run on some CI but used inside a different project, so I'm not 100% sure. I can see this in pubspec

  sdk: ">=2.16.1 <3.0.0"

let me try bumping it to >3.2.0.

For now changing the json_serializable from ^6.0.0 to e.g. 6.6.2 will fix it.

@MakSinroja
Copy link

Facing the same issue

Error: Expected ')' before this.

@kevmoo
Copy link
Collaborator

kevmoo commented Dec 6, 2024

@MakSinroja – I belive you need to bump the min SDK version of your package to ^3.0.0

I'll add a check for this in the generator.

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

3 participants