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

analyzer 5.11.0 + dart_style 2.3.0 breaks build_runner build #52159

Closed
point-source opened this issue Apr 24, 2023 · 9 comments
Closed

analyzer 5.11.0 + dart_style 2.3.0 breaks build_runner build #52159

point-source opened this issue Apr 24, 2023 · 9 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on

Comments

@point-source
Copy link

point-source commented Apr 24, 2023

I am using these dependencies to generate a library from a swagger file:

  • analyzer: 5.11.0
  • dart_style: 2.3.0
  • swagger_dart_code_generator: 2.10.4

When I try to build via flutter pub run build_runner build --delete-conflicting-outputs, I get the following error:

../../../../../.pub-cache/hosted/pub.dev/dart_style-2.3.0/lib/src/source_visitor.dart:2218:19: Error: The getter 'interfaceKeyword' isn't defined for the class 'MixinDeclaration'.
 - 'MixinDeclaration' is from 'package:analyzer/dart/ast/ast.dart' ('../../../../../.pub-cache/hosted/pub.dev/analyzer-5.11.0/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'interfaceKeyword'.
    modifier(node.interfaceKeyword);
                  ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/dart_style-2.3.0/lib/src/source_visitor.dart:2219:19: Error: The getter 'finalKeyword' isn't defined for the class 'MixinDeclaration'.
 - 'MixinDeclaration' is from 'package:analyzer/dart/ast/ast.dart' ('../../../../../.pub-cache/hosted/pub.dev/analyzer-5.11.0/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'finalKeyword'.
    modifier(node.finalKeyword);
                  ^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/dart_style-2.3.0/lib/src/source_visitor.dart:2220:19: Error: The getter 'sealedKeyword' isn't defined for the class 'MixinDeclaration'.
 - 'MixinDeclaration' is from 'package:analyzer/dart/ast/ast.dart' ('../../../../../.pub-cache/hosted/pub.dev/analyzer-5.11.0/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'sealedKeyword'.
    modifier(node.sealedKeyword);
  • Dart SDK version: 2.19.0 (stable) (Mon Jan 23 11:29:09 2023 -0800) on "macos_arm64"
  • OS: macOS 13.3.1 (22E261)

Downgrading analyzer to 5.10.0 resolves the issue.

@parlough
Copy link
Member

parlough commented Apr 24, 2023

\cc @scheglov @munificent I think this incompatibility could affect a large number of users and it may not be clear to users to add an override for the analyzer version since it's often a transitive dependency in these cases.

Also tracked at dart-lang/build#3489

@fertrig
Copy link

fertrig commented Apr 24, 2023

Workaround. Add to pubspec.yaml:

dependency_overrides:
  analyzer: 5.10.0

@annagrin
Copy link
Contributor

@scheglov Should the analyzer version be 6.0.0 (instead of 5.11.0) for this breaking update?

@scheglov scheglov self-assigned this Apr 24, 2023
@scheglov
Copy link
Contributor

Apparently it was removed in https://dart-review.googlesource.com/c/sdk/+/290614
I had not seen this CL, so missed this fact.
I will publish 5.11.1 with these getters restored.

@scheglov
Copy link
Contributor

https://dart-review.googlesource.com/c/sdk/+/297980

@scheglov
Copy link
Contributor

Successfully uploaded https://pub.dev/packages/analyzer version 5.11.1.

Please check if this helps.

@parlough
Copy link
Member

Worked for me, thanks!

copybara-service bot pushed a commit that referenced this issue Apr 25, 2023
Bug: #52159
Change-Id: Ia603e77694d11af1045a94bdf00468d02eb5f6af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@devoncarew devoncarew added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Apr 25, 2023
@jjoelson
Copy link

Successfully uploaded https://pub.dev/packages/analyzer version 5.11.1.

Please check if this helps.

I briefly encountered this error yesterday and now it's working, so I think this worked 👍

@scheglov scheglov added the P2 A bug or feature request we're likely to work on label Apr 25, 2023
@annagrin
Copy link
Contributor

Works for me too, thanks @scheglov!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

7 participants