dio icon indicating copy to clipboard operation
dio copied to clipboard

解决 WEB 端BUG

Open wskfjtheqian opened this issue 3 years ago • 1 comments

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 develop to 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

...

wskfjtheqian avatar Sep 15 '22 07:09 wskfjtheqian

解决BUG

wskfjtheqian avatar Sep 15 '22 07:09 wskfjtheqian

This really needs to be added. Currently, all requests on web will timeout even if it has been completed.

bitcode92 avatar Sep 28 '22 15:09 bitcode92

[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 dart-sdk/lib/async/zone.dart 1434:47 _rootRunUnary dart-sdk/lib/async/zone.dart 1335:19 runUnary dart-sdk/lib/async/future_impl.dart 147:18 handleValue dart-sdk/lib/async/future_impl.dart 766:44 handleValueCallback dart-sdk/lib/async/future_impl.dart 795:13 _propagateToListeners dart-sdk/lib/async/future_impl.dart 557:7 [_complete] dart-sdk/lib/async/future.dart 420:15 dart-sdk/lib/async/zone.dart 1418:47 _rootRun dart-sdk/lib/async/zone.dart 1328:19 run dart-sdk/lib/async/zone.dart 1236:7 runGuarded dart-sdk/lib/async/zone.dart 1276:23 dart-sdk/lib/async/zone.dart 1426:13 _rootRun dart-sdk/lib/async/zone.dart 1328:19 run dart-sdk/lib/async/zone.dart 1260:23 dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19 internalCallback

bitcode92 avatar Sep 28 '22 15:09 bitcode92

I saw #1550 #1496 #1470 both fix this.

AlexV525 avatar Oct 20 '22 03:10 AlexV525

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.

AlexV525 avatar Dec 18 '22 15:12 AlexV525