4D-Technologies / openidconnect_flutter

Complete Flutter OpenIdConnect Library
75 stars 44 forks source link

XMLHttpRequest error after upgrade to flutter 2.8.1 #14

Open drsarutobi8 opened 2 years ago

drsarutobi8 commented 2 years ago

after complete the user Id and password from Keycloak login, the flutter report error:

Error: XMLHttpRequest error.
    dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 906:28                get current
packages/http/src/browser_client.dart 71:22                                       <fn>
dart-sdk/lib/async/zone.dart 1687:54                                              runUnary
dart-sdk/lib/async/future_impl.dart 160:18                                        handleValue
dart-sdk/lib/async/future_impl.dart 767:44                                        handleValueCallback
dart-sdk/lib/async/future_impl.dart 796:13                                        _propagateToListeners
dart-sdk/lib/async/future_impl.dart 593:7                                         [_complete]
dart-sdk/lib/async/stream_pipe.dart 61:11                                         _cancelAndValue
dart-sdk/lib/async/stream.dart 1288:7                                             <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 334:14  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 339:39  dcall
dart-sdk/lib/html/dart2js/html_dart2js.dart 37254:58                              <fn>

    at Object.createErrorWithStack (http://localhost:4200/dart_sdk.js:5076:12)
    at Object._rethrow (http://localhost:4200/dart_sdk.js:40477:16)
    at async._AsyncCallbackEntry.new.callback (http://localhost:4200/dart_sdk.js:40473:13)
    at Object._microtaskLoop (http://localhost:4200/dart_sdk.js:40330:13)
    at _startMicrotaskLoop (http://localhost:4200/dart_sdk.js:40336:13)
    at http://localhost:4200/dart_sdk.js:35811:9

my guess this happens in callback.

huynguyennovem commented 2 years ago

This may help you: https://stackoverflow.com/a/66879350/5921933

1- Go to flutter\bin\cache and remove a file named: flutter_tools.stamp

2- Go to flutter\packages\flutter_tools\lib\src\web and open the file chrome.dart.

3- Find '--disable-extensions'

4- Add '--disable-web-security'