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] InconsistentAnalysisException: Requested result might be inconsistent with previously returned results #48658

Closed
jinaiyuanbaojie opened this issue Mar 24, 2022 · 11 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@jinaiyuanbaojie
Copy link

jinaiyuanbaojie commented Mar 24, 2022

analyzer Meet this issue after upgrading to 3.4.0

build_runner works well with the old one 3.3.1

What I am using is freezed. This a popular package based on code generation.

@jinaiyuanbaojie jinaiyuanbaojie changed the title InconsistentAnalysisException: Requested result might be inconsistent with previously returned results [analyzer] InconsistentAnalysisException: Requested result might be inconsistent with previously returned results Mar 24, 2022
@spydon
Copy link
Contributor

spydon commented Mar 24, 2022

We are facing this too.

A workaround is to specifically set analyzer as 3.3.1 in dependency_overrides in your project's pubspec.yaml file:

dependency_overrides:
  analyzer: 3.3.1

@bwilkerson
Copy link
Member

@jakemac53

@jakemac53
Copy link
Contributor

This looks related to analyzer 3.4.0, we need to figure out what the best resolution would be.

cc @scheglov would it be reasonable to roll this back in a 3.4.1 release in the meantime? I think most projects are broken, lots of reports.

@jinaiyuanbaojie
Copy link
Author

We are facing this too.

A workaround is to specifically set analyzer as 3.3.1 in dependency_overrides in your project's pubspec.yaml file:

dependency_overrides:
  analyzer: 3.3.1

Yep. That is my solution. But I hate workaround

@scheglov scheglov self-assigned this Mar 24, 2022
@scheglov scheglov added P1 A high priority bug; for example, a single project is unusable or has many test failures area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Mar 24, 2022
@scheglov
Copy link
Contributor

I don't use freezed, but I saw similar issue with drift. dart-lang/build#3269

I will revert the check for consistency after operations, and leave it to be only directly before one. This helps drift.

@scheglov
Copy link
Contributor

@scheglov
Copy link
Contributor

analyzer 3.4.1 was published

copybara-service bot pushed a commit that referenced this issue Mar 24, 2022
Bug: #48658
Change-Id: I1d3d531cf3550a657a1cdd9d7a29467e4c92df0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov
Copy link
Contributor

Probably fixed, at least for drift. Reopen if you still see it.

@ferndot
Copy link

ferndot commented Mar 25, 2022

Thanks for the quick fix! 🌹

@jinaiyuanbaojie
Copy link
Author

Probably fixed, at least for drift. Reopen if you still see it.

Many thanks. works well from my side

@spydon
Copy link
Contributor

spydon commented Mar 25, 2022

I can confirm that it works for freezed as well, thanks for the quick turn-around time on this issue!

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. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

6 participants