-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Unsupported operation: Undetermined Nullability #48752
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
Comments
Also using Riverpod and getting this issue. I am able to build a release build, but in debug, it crashes every time. |
@hamishjohnson How did you figure out which line was causing the issue? I'm not able to get any details about that in the stack trace? |
I was just trial and errored it. By the way, I updated the post with a fix (wrapping in a Future) in case that helps you. Check if you have any FutureProviders that aren't returning a Future. If not, it might be an unrelated issue But the bug still exists |
Highlighting the stack trace from above:
|
Maybe related to: FYI: @chloestefantsova |
@chloestefantsova recently fixed two similar issues. One has already rolled into flutter main, but the second hasn't yet. The second fix was for an issue reported by another user with a RiverPod dependency #48631 (comment). I suspect this will be fixed by one of those changes and I'd like to verify if the issue is still present at flutter master after the second fix has rolled in. |
I think so too, that my recent fix should resolve this issue. I try to locally verify that. |
Ok, @whesse checked the fix that's already in the Dart SDK, and it seems to work. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
This code crashes when you build for web, but not for mobile.
I'm able to reproduce with the Riverpod package, but I don't know enough about the problem to reproduce without riverpod. I opened an issue there but maintainer Remi Rousselet believes it's a dart issue, so I'm reposting here.
To Reproduce
Expected behavior
Run on mobile, works fine. Run on web, compile crashes.
When adding 'async' to the provided create function, it works fine.
Error
Edit:
I forgot to add that I was able to fix the issue in the meantime by wrapping the value in a future, like so
Replace
if (condition) return 'child'; // <==== This line is what causes the bug
With
if (condition) return Future.value('child');
In case that helps anybody
The text was updated successfully, but these errors were encountered: