解决 WEB 端BUG
errors.dart:266 Uncaught (in promise) Error: Bad state: Future already completed at Object.throw_ [as throw] (errors.dart:266:49) at _AsyncCompleter.new.completeError (future_impl.dart:15:79) at browser_adapter.dart:70:22 at _RootZone.runUnary (zone.dart:1653:54) at _FutureListener.then.handleValue (future_impl.dart:147:18) at handleValueCallback (future_impl.dart:766:44) at _Future._propagateToListeners (future_impl.dart:795:13) at [_complete] (future_impl.dart:557:7) at future.dart:421:15 at internalCallback (isolate_helper.dart:48:19)
New Pull Request Checklist
- [ ] I have read the Documentation
- [ ] I have searched for a similar pull request in the project and found none
- [ ] I have updated this branch with the latest
developto avoid conflicts (via merge from master or rebase) - [ ] I have added the required tests to prove the fix/feature I am adding
- [ ] I have updated the documentation (if necessary)
- [ ] I have run the tests and they pass
This merge request fixes / refers to the following issues: ...
Pull Request Description
...
解决BUG
This really needs to be added. Currently, all requests on web will timeout even if it has been completed.
[ERROR] dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49 throw
dart-sdk/lib/async/future_impl.dart 15:79 completeError
packages/dio/src/adapters/browser_adapter.dart 70:22
I saw #1550 #1496 #1470 both fix this.
Hi everyone! We've made our hardfork repo public and published a new version of dio, named diox.
The new package contains the PR of the fix (#1550).
Please refer to https://pub.dev/packages/diox/versions/5.0.0-dev.1 to use the fork.
You can also see why we're working for a hardfork at https://github.com/cfug/diox/issues/29 and https://github.com/flutterchina/dio/issues/1607.