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

flutter-web >>> dio >>> DioError [DioErrorType.DEFAULT]: Unsupported operation: RawSocket constructor #992

Closed
1 task done
mnlin0905 opened this issue Nov 15, 2020 · 8 comments

Comments

@mnlin0905
Copy link

mnlin0905 commented Nov 15, 2020

New Issue Checklist

  • I have searched for a similar issue in the project and found none

Issue Info

Flutter 1.23.0-18.1.pre • channel beta • https://gitee.com/mirrors/Flutter.git
Framework • revision 198df796aa (4 weeks ago) • 2020-10-15 12:04:33 -0700
Engine • revision 1d12d82d9c
Tools • Dart 2.11.0 (build 2.11.0-213.1.beta)

Issue Description and Steps

code:

      var dio = Dio(BaseOptions(responseType: ResponseType.plain))
        ..interceptors.add(LogInterceptor())
        ..httpClientAdapter = Http2Adapter(
          ConnectionManager(idleTimeout: 5000),
        );


      var response = await dio.get("http://localhost:8888/",options: Options(responseType: ResponseType.plain));

When it execute, then get the following error:

*** Request ***
uri: http://localhost:8888/
method: GET
responseType: ResponseType.plain
followRedirects: true
connectTimeout: 0
receiveTimeout: 0
extra: {}
headers:
 content-type: application/json; charset=utf-8

*** DioError ***:
uri: http://localhost:8888/
DioError [DioErrorType.DEFAULT]: Unsupported operation: RawSocket constructor
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 216:49  throw_
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart 479:5               connect
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/io/secure_socket.dart 233:60                                     connect
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/io/secure_socket.dart 54:10                                      connect
packages/dio_http2_adapter/src/connection_manager_imp.dart 72:35                                                           _connect
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54            runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12           _async
packages/dio_http2_adapter/src/connection_manager_imp.dart 61:51                                                           [_connect]
packages/dio_http2_adapter/src/connection_manager_imp.dart 42:49                                                           getConnection
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54            runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12           _async
packages/dio_http2_adapter/src/connection_manager_imp.dart 30:50                                                           getConnection
packages/dio_http2_adapter/src/http2_adapter.dart 38:44                                                                    _fetch$
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54            runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12           _async
packages/dio_http2_adapter/src/http2_adapter.dart 32:30                                                                    [_fetch]
packages/dio_http2_adapter/src/http2_adapter.dart 29:12                                                                    fetch
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54            runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12           _async
packages/dio_http2_adapter/src/http2_adapter.dart 23:29                                                                    fetch
packages/dio/src/dio.dart 922:46                                                                                           _dispatchRequest
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50            <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1450:54                                          runUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 143:18                                    handleValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 696:44                                    handleValueCallback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 725:32                                    _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 529:5                                     [_completeWithValue]
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 567:7                                     callback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 41:11                              _microtaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 50:5                               _startMicrotaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15           <fn>

I don't quite understand what RawSocket constructor means

Can you help me?

@XB-Paul
Copy link

XB-Paul commented Dec 11, 2020

@lovingning Has the problem been solved?

@stale
Copy link

stale bot commented Jan 10, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

@stale stale bot added the stale label Jan 10, 2021
@stale stale bot closed this as completed Jan 17, 2021
@e01-cry
Copy link

e01-cry commented Dec 17, 2021

@lovingning Has the problem been solved?

1 similar comment
@Alembertcn
Copy link

@lovingning Has the problem been solved?

@AlexSmirnov9107
Copy link

@lovingning any updates?

@mahdimoaz
Copy link

This problem still exists

@Pluto1219
Copy link

+1

@zs-dima
Copy link

zs-dima commented Apr 9, 2023

This issue related to the dio_http2_adapter interceptor, as dio_http2_adapter does not support Web for now.
https://pub.dev/packages/dio_http2_adapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants