-
Notifications
You must be signed in to change notification settings - Fork 210
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
InconsistentAnalysisException: Requested result might be inconsistent with previously returned results #2689
Comments
We are trying to track this down but haven't had any luck so far. |
thanks for having a look @jakemac53 , please excuse me for not knowing even where to start with looking at this error, however, maybe some clues for you: Intermittently but regularly, if I make a change to a file where code gen is required, then I get the error |
Note the word cached in brackets (deleting the files doesn't help though) |
I have made some traction on this issue, see the repro I added in #2705. Essentially, any call to Specifically grabbing the The workaround is to grab a new LibraryElement - using
|
cc @stereotype441 @scheglov for fyi (see my last comment). We might want to chat about this and see if there is some more elegant workaround or fix. |
I don't know what |
If those assets have not been seen before then they can cause calls to We used to simply not allow resolving any files not imported by the primary entrypoint which is why this issue came up recently (we started allowing you to resolve additional files, including ones you just output). I do understand why this would invalidate the session - the question I had for you all is what the best remedy might be to suggest when people run into this. |
Maybe the analyzer could add some features to make the this easier for builder authors:
|
@jakemac53 Why do we have to call You don't have to do anything special to ask for a @simolus3 We could add |
File contents never change, but new files get written, including those which are already imported from places that we previously analyzed when they were missing.
Some confusion, we call build/build_resolvers/lib/src/build_asset_uri_resolver.dart Lines 85 to 91 in 70add12
Then for either of those cases we call
We're handling the case where
The We also don't have a lock around this, so different builders cant add files while some other builder is using an analysis sessions, but that isn't necessary to reproduce what we are seeing. |
Thank you for the explanation. Yes, if we need to create previously not existed, but already read files, then we need to call I can add @simolus3 As for requesting corresponding element, I'd like to know which elements you want to request, and why. |
@scheglov For me, this came up when trying to load the ast node defining an element (where |
This comment has been minimized.
This comment has been minimized.
Closing this - I don't think there is anything actionable on this repo at this point. See my comment here #2634 (comment). If we want/need a new api in analyzer lets create an issue in the SDK issue tracker for that. |
- Attempt to avoid `build` issue: - `InconsistentAnalysisException: Requested result might be inconsistent with previously returned results` #2689 - dart-lang/build#2689 - mime: ^1.0.4 - build_test: ^2.1.6 - test: ^1.22.2 - coverage: ^1.6.2
- Attempt to avoid `build` issue: - `InconsistentAnalysisException: Requested result might be inconsistent with previously returned results` #2689 - dart-lang/build#2689 - mime: ^1.0.4 - build_test: ^2.1.6 - test: ^1.22.2 - coverage: ^1.6.2
Hi, I'm getting the following error on build, any ideas please?
I have since upgraded to Dart 2.8.1.
Renaming the files fixes the problem temporarily
dart-lang/sdk#41298
The text was updated successfully, but these errors were encountered: