cfug/dio

Error Dio flutter web

Thibault4 opened this issue · 1 comments

Package

dio

Version

5.4.3

Operating-System

Web

Adapter

Default Dio

Output of flutter doctor -v

[✓] Flutter (Channel stable, 3.22.2, on macOS 14.4.1 23E224 darwin-arm64, locale fr-FR)
    • Flutter version 3.22.2 on channel stable at /Volumes/T7/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (8 days ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/thibault.boulay/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.85.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.90.0

[✓] Connected device (2 available)
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 125.0.6422.142
    ! Error: Browsing on the local area network for iPhone de Thibault. Ensure the device is unlocked and attached with a cable or associated with the same
      local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for iPhone de Mathis Rezai. Ensure the device is unlocked and attached with a cable or associated with the
      same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Dart Version

Dart SDK version: 3.4.3 (stable) (Tue Jun 4 19:51:39 2024 +0000) on "macos_arm64"

Steps to Reproduce

try {
      final response = await Dio().get(
        url,
      );
      if (response.statusCode == 200) {
        processTags(response.data);
        Constants.prefs!.setString(
            '${tag}_${Constants.language}', jsonEncode(response.data));
      } else {
        throw Exception('Failed to load tags');
      }
    } on Exception catch (_, e) {
      debugPrint(e.toString());
    }
    
Url = https://static.decibell.org/tags/tags_fr.json
    

Expected Result

Make bug into console

Actual Result

Une exception s'est produite.
Error
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3 throw
packages/dio/src/dio_mixin.dart 509:7 fetch
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 60:31
dart-sdk/lib/async/zone.dart 1666:54 runBinary
dart-sdk/lib/async/future_impl.dart 178:22 handleError
dart-sdk/lib/async/future_impl.dart 859:46 handleError
dart-sdk/lib/async/future_impl.dart 880:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 660:5 [_completeError]
dart-sdk/lib/async/future_impl.dart 746:7 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7