You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
based on this issue, I added a minimal sample code. The problem is, that the user has their own customHttpClient, which the user uses in the app. Therefore the user sets the no_default_http_client=true flag, but package_info_plus needs a httpClient, but has no parameter to set the httpClient.
Add package_info_plus: ^8.1.1 and http: ^1.2.2 to the pubspec.yml
Build with flutter build web --release --source-maps --dart-define=no_default_http_client=true
Uncaught Error: Bad state: no_default_http_client was defined but runWithClient was not used to configure a Client implementation.
at Object.e (js_helper.dart:1198:19)
at Object.ahp (browser_client.dart:23:5)
at Object.aa1 (client.dart:42:37)
at http.dart:165:16
at Yj.a (async_patch.dart:303:19)
at Yj.$2 (async_patch.dart:328:23)
at Object.N (async_patch.dart:233:3)
at Object.agT (http.dart:165:7)
at Object.a0u (http.dart:165:7)
at Object.ahL (http.dart:49:5)
Flutter Doctor
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.1.1 24B91 darwin-arm64, locale en-AT)
• Flutter version 3.24.3 on channel stable at /Users/martin/fvm/versions/3.24.3
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (3 months ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
• Android SDK at /Users/martin/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16B40
• CocoaPods version 1.16.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.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.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (version 1.95.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.102.0
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.1.1 24B91 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.1.1 24B91 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.86
[✓] Network resources
• All expected network resources are available.
Checklist before submitting a bug
I searched issues in this repository and couldn't find such bug/problem
I Google'd a solution and I couldn't find it
I searched on StackOverflow for a solution and I couldn't find it
I read the README.md file of the plugin
I'm using the latest version of the plugin
All dependencies are up to date with flutter pub upgrade
I did a flutter clean
I tried running the example project
The text was updated successfully, but these errors were encountered:
package_info_plus uses the http client to obtain the version.json containing the package info in web apps.
My only recommendation would be to fork the project and adapt it to your own needs, e.g. remove the web implementation or modify it to pass the http client that you prefer.
Platform
Web
Plugin
package_info_plus
Version
8.1.1
Flutter SDK
3.24.3
Steps to reproduce
Hello,
based on this issue, I added a minimal sample code. The problem is, that the user has their own
customHttpClient
, which the user uses in the app. Therefore the user sets theno_default_http_client=true
flag, butpackage_info_plus
needs ahttpClient
, but has no parameter to set thehttpClient
.Add
package_info_plus: ^8.1.1
andhttp: ^1.2.2
to the pubspec.ymlBuild with
flutter build web --release --source-maps --dart-define=no_default_http_client=true
And run with
python3 -m http.server 8089
Code Sample
Logs
Uncaught Error: Bad state: no_default_http_client was defined but runWithClient was not used to configure a Client implementation. at Object.e (js_helper.dart:1198:19) at Object.ahp (browser_client.dart:23:5) at Object.aa1 (client.dart:42:37) at http.dart:165:16 at Yj.a (async_patch.dart:303:19) at Yj.$2 (async_patch.dart:328:23) at Object.N (async_patch.dart:233:3) at Object.agT (http.dart:165:7) at Object.a0u (http.dart:165:7) at Object.ahL (http.dart:49:5)
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean
The text was updated successfully, but these errors were encountered: