client.js:9831 Unhandled error detected in the injected client.js script. Flutter 3.16.7, MacOS 14.1.1, Chrome Version 120.0.6099.216 (x86_64)
Attempting to run a hello world Flutter app from flutter create using command flutter run -d chrome results in a Chrome window with a blue indefinite progress indicator animating at the top and a white screen below it. Opening Chrome Dev Tools console shows following message. AFAIKT it has not begin executing from main.dart at this point.
Flutter 3.16.7 MacOS 14.1.1 Chrome Version 120.0.6099.216 (x86_64)
hello % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.7, on macOS 14.1.1 23B81 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.85.1)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!
client.js:9831 Unhandled error detected in the injected client.js script.
You can disable this script in webdev by passing --no-injected-client if it is preventing your app from loading, but note that this will also prevent all debugging and hot reload/restart functionality from working.
The original error is below, please file an issue at https://github.com/dart-lang/webdev/issues/new and attach this output:
Assertion failed: "boolean expression must not be null"
Assertion failed: "boolean expression must not be null"
at Object.wrapException (http://localhost:61137/dwds/src/injected/client.js:1420:43)
at Object.assertThrow (http://localhost:61137/dwds/src/injected/client.js:1871:15)
at Object.boolConversionCheck (http://localhost:61137/dwds/src/injected/client.js:1867:11)
at http://localhost:61137/dwds/src/injected/client.js:25481:21
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:61137/dwds/src/injected/client.js:4009:15)
at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:61137/dwds/src/injected/client.js:12242:12)
at _awaitOnObject_closure.call$1 (http://localhost:61137/dwds/src/injected/client.js:12230:32)
at StaticClosure._rootRunUnary (http://localhost:61137/dwds/src/injected/client.js:4391:18)
at _CustomZone.runUnary$2$2 (http://localhost:61137/dwds/src/injected/client.js:13637:39)
at _Future__propagateToListeners_handleValueCallback.call$0 (http://localhost:61137/dwds/src/injected/client.js:12668:51)
at Object._Future__propagateToListeners (http://localhost:61137/dwds/src/injected/client.js:4174:93)
at _Future._completeWithValue$1 (http://localhost:61137/dwds/src/injected/client.js:12504:9)
at _AsyncAwaitCompleter.complete$1 (http://localhost:61137/dwds/src/injected/client.js:12216:14)
at Object._asyncReturn (http://localhost:61137/dwds/src/injected/client.js:3981:17)
at http://localhost:61137/dwds/src/injected/client.js:9758:24
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:61137/dwds/src/injected/client.js:4009:15)
at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:61137/dwds/src/injected/client.js:12242:12)
at _awaitOnObject_closure.call$1 (http://localhost:61137/dwds/src/injected/client.js:12230:32)
at StaticClosure._rootRunUnary (http://localhost:61137/dwds/src/injected/client.js:4391:18)
at _CustomZone.runUnary$2$2 (http://localhost:61137/dwds/src/injected/client.js:13637:39)
at _Future__propagateToListeners_handleValueCallback.call$0 (http://localhost:61137/dwds/src/injected/client.js:12668:51)
at Object._Future__propagateToListeners (http://localhost:61137/dwds/src/injected/client.js:4174:93)
at _Future._completeWithValue$1 (http://localhost:61137/dwds/src/injected/client.js:12504:9)
at _AsyncAwaitCompleter.complete$1 (http://localhost:61137/dwds/src/injected/client.js:12216:14)
at Object._asyncReturn (http://localhost:61137/dwds/src/injected/client.js:3981:17)
at http://localhost:61137/dwds/src/injected/client.js:26112:24
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:61137/dwds/src/injected/client.js:4009:15)
at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:61137/dwds/src/injected/client.js:12242:12)
at _awaitOnObject_closure.call$1 (http://localhost:61137/dwds/src/injected/client.js:12230:32)
at StaticClosure._rootRunUnary (http://localhost:61137/dwds/src/injected/client.js:4391:18)
at _CustomZone.runUnary$2$2 (http://localhost:61137/dwds/src/injected/client.js:13637:39)
at _Future__propagateToListeners_handleValueCallback.call$0 (http://localhost:61137/dwds/src/injected/client.js:12668:51)
at Object._Future__propagateToListeners (http://localhost:61137/dwds/src/injected/client.js:4174:93)
at _Future._completeWithValue$1 (http://localhost:61137/dwds/src/injected/client.js:12504:9)
at _AsyncAwaitCompleter.complete$1 (http://localhost:61137/dwds/src/injected/client.js:12216:14)
at Object._asyncReturn (http://localhost:61137/dwds/src/injected/client.js:3981:17)
at http://localhost:61137/dwds/src/injected/client.js:26089:24
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:61137/dwds/src/injected/client.js:4009:15)
at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:61137/dwds/src/injected/client.js:12242:12)
at _awaitOnObject_closure.call$1 (http://localhost:61137/dwds/src/injected/client.js:12230:32)
at StaticClosure._rootRunUnary (http://localhost:61137/dwds/src/injected/client.js:4391:18)
at _CustomZone.runUnary$2$2 (http://localhost:61137/dwds/src/injected/client.js:13637:39)
at _Future__propagateToListeners_handleValueCallback.call$0 (http://localhost:61137/dwds/src/injected/client.js:12668:51)
at Object._Future__propagateToListeners (http://localhost:61137/dwds/src/injected/client.js:4174:93)
at _Future._completeWithValue$1 (http://localhost:61137/dwds/src/injected/client.js:12504:9)
at _Future__asyncCompleteWithValue_closure.call$0 (http://localhost:61137/dwds/src/injected/client.js:12608:18)
at StaticClosure._rootRun (http://localhost:61137/dwds/src/injected/client.js:4376:16)
at _CustomZone.run$1$1 (http://localhost:61137/dwds/src/injected/client.js:13629:39)
at _CustomZone.runGuarded$1 (http://localhost:61137/dwds/src/injected/client.js:13572:14)
at _CustomZone_bindCallbackGuarded_closure.call$0 (http://localhost:61137/dwds/src/injected/client.js:13767:25)
at Object._microtaskLoop (http://localhost:61137/dwds/src/injected/client.js:4235:24)
at StaticClosure._startMicrotaskLoop (http://localhost:61137/dwds/src/injected/client.js:4241:11)
at _AsyncRun__initializeScheduleImmediate_internalCallback.call$1 (http://localhost:61137/dwds/src/injected/client.js:12119:9)
Interesting, this looks the same as https://github.com/dart-lang/webdev/issues/2332 which was resolved by updating to the latest Flutter stable (which you are already on).
Could you try the steps suggested here: https://github.com/dart-lang/webdev/issues/2332#issuecomment-1885432333
Thanks!
Closing due to inactivity.