Flutter Web:在 flutter 运行 上注入的 client.js 脚本中检测到未处理的错误
Flutter Web: Unhandled error detected in the injected client.js script on flutter run
我在 运行 flutter run -d chrome
时遇到以下错误。我无法弄清楚这个错误是从哪里来的。我尝试了 中的解决方案,但没有任何改变。
Doctor summary (to see all details, run flutter doctor -v): [✓]
Flutter (Channel unknown, 1.20.2, on Linux, locale en_CA.UTF-8) [✓]
Android toolchain - develop for Android devices (Android SDK version
30.0.0) [✓] Chrome - develop for the web [✓] Android Studio (version 4.0) [✓] Connected device (4 available)
你能帮忙吗?
client.js:3316 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:
NoSuchMethodError: method not found: 'get$digestsPath' (J.getInterceptor$x(...).get$digestsPath is not a function)
TypeError: J.getInterceptor$x(...).get$digestsPath is not a function
at Object.get$digestsPath$x (http://localhost:35691/dwds/src/injected/client.js:3529:43)
at http://localhost:35691/dwds/src/injected/client.js:22757:60
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:35691/dwds/src/injected/client.js:3824:15)
at _wrapJsFunctionForAsync_closure.call (http://localhost:35691/dwds/src/injected/client.js:11021:12)
at Object._asyncStartSync (http://localhost:35691/dwds/src/injected/client.js:3788:20)
at RequireRestarter._getDigests[=12=] (http://localhost:35691/dwds/src/injected/client.js:22769:16)
at http://localhost:35691/dwds/src/injected/client.js:22784:48
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:35691/dwds/src/injected/client.js:3824:15)
at _wrapJsFunctionForAsync_closure.call (http://localhost:35691/dwds/src/injected/client.js:11021:12)
at Object._asyncStartSync (http://localhost:35691/dwds/src/injected/client.js:3788:20)
at RequireRestarter._initialize[=12=] (http://localhost:35691/dwds/src/injected/client.js:22792:16)
at http://localhost:35691/dwds/src/injected/client.js:8594:45
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:35691/dwds/src/injected/client.js:3824:15)
at _wrapJsFunctionForAsync_closure.call (http://localhost:35691/dwds/src/injected/client.js:11021:12)
at Object._asyncStartSync (http://localhost:35691/dwds/src/injected/client.js:3788:20)
at Object.RequireRestarter_create (http://localhost:35691/dwds/src/injected/client.js:8606:16)
at http://localhost:35691/dwds/src/injected/client.js:22344:38
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:35691/dwds/src/injected/client.js:3824:15)
at _wrapJsFunctionForAsync_closure.call (http://localhost:35691/dwds/src/injected/client.js:11021:12)
at _awaitOnObject_closure.call (http://localhost:35691/dwds/src/injected/client.js:11007:32)
at StaticClosure._rootRunUnary [as call] (http://localhost:35691/dwds/src/injected/client.js:4152:18)
at _CustomZone.runUnary (http://localhost:35691/dwds/src/injected/client.js:12326:39)
at _Future__propagateToListeners_handleValueCallback.call[=12=] (http://localhost:35691/dwds/src/injected/client.js:11387:51)
at Object._Future__propagateToListeners (http://localhost:35691/dwds/src/injected/client.js:3936:93)
at _Future._complete (http://localhost:35691/dwds/src/injected/client.js:11211:11)
at Object._cancelAndValue (http://localhost:35691/dwds/src/injected/client.js:4091:16)
at Stream_first_closure0.call (http://localhost:35691/dwds/src/injected/client.js:11479:9)
at _EventStreamSubscription_onData_closure.call (http://localhost:35691/dwds/src/injected/client.js:17334:30)
at StaticClosure._rootRunUnary [as call] (http://localhost:35691/dwds/src/injected/client.js:4158:16)
at _CustomZone.runUnary (http://localhost:35691/dwds/src/injected/client.js:12326:39)
at _CustomZone.runUnaryGuarded (http://localhost:35691/dwds/src/injected/client.js:12258:14)
at _CustomZone_bindUnaryCallbackGuarded_closure.call (http://localhost:35691/dwds/src/injected/client.js:12461:25)
at invokeClosure (http://localhost:35691/dwds/src/injected/client.js:1205:26)
at EventSource.<anonymous> (http://localhost:35691/dwds/src/injected/client.js:1224:18)
看来是 Chrome 更改导致的问题已通过 Dart SDK 中的更改得到解决。
A flutter upgrade
将为您提供可解决此错误的最新 Dark SDK。
More information on the SDK update 在 Github
我在 运行 flutter run -d chrome
时遇到以下错误。我无法弄清楚这个错误是从哪里来的。我尝试了
Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel unknown, 1.20.2, on Linux, locale en_CA.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0) [✓] Chrome - develop for the web [✓] Android Studio (version 4.0) [✓] Connected device (4 available)
你能帮忙吗?
client.js:3316 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:
NoSuchMethodError: method not found: 'get$digestsPath' (J.getInterceptor$x(...).get$digestsPath is not a function)
TypeError: J.getInterceptor$x(...).get$digestsPath is not a function
at Object.get$digestsPath$x (http://localhost:35691/dwds/src/injected/client.js:3529:43)
at http://localhost:35691/dwds/src/injected/client.js:22757:60
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:35691/dwds/src/injected/client.js:3824:15)
at _wrapJsFunctionForAsync_closure.call (http://localhost:35691/dwds/src/injected/client.js:11021:12)
at Object._asyncStartSync (http://localhost:35691/dwds/src/injected/client.js:3788:20)
at RequireRestarter._getDigests[=12=] (http://localhost:35691/dwds/src/injected/client.js:22769:16)
at http://localhost:35691/dwds/src/injected/client.js:22784:48
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:35691/dwds/src/injected/client.js:3824:15)
at _wrapJsFunctionForAsync_closure.call (http://localhost:35691/dwds/src/injected/client.js:11021:12)
at Object._asyncStartSync (http://localhost:35691/dwds/src/injected/client.js:3788:20)
at RequireRestarter._initialize[=12=] (http://localhost:35691/dwds/src/injected/client.js:22792:16)
at http://localhost:35691/dwds/src/injected/client.js:8594:45
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:35691/dwds/src/injected/client.js:3824:15)
at _wrapJsFunctionForAsync_closure.call (http://localhost:35691/dwds/src/injected/client.js:11021:12)
at Object._asyncStartSync (http://localhost:35691/dwds/src/injected/client.js:3788:20)
at Object.RequireRestarter_create (http://localhost:35691/dwds/src/injected/client.js:8606:16)
at http://localhost:35691/dwds/src/injected/client.js:22344:38
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:35691/dwds/src/injected/client.js:3824:15)
at _wrapJsFunctionForAsync_closure.call (http://localhost:35691/dwds/src/injected/client.js:11021:12)
at _awaitOnObject_closure.call (http://localhost:35691/dwds/src/injected/client.js:11007:32)
at StaticClosure._rootRunUnary [as call] (http://localhost:35691/dwds/src/injected/client.js:4152:18)
at _CustomZone.runUnary (http://localhost:35691/dwds/src/injected/client.js:12326:39)
at _Future__propagateToListeners_handleValueCallback.call[=12=] (http://localhost:35691/dwds/src/injected/client.js:11387:51)
at Object._Future__propagateToListeners (http://localhost:35691/dwds/src/injected/client.js:3936:93)
at _Future._complete (http://localhost:35691/dwds/src/injected/client.js:11211:11)
at Object._cancelAndValue (http://localhost:35691/dwds/src/injected/client.js:4091:16)
at Stream_first_closure0.call (http://localhost:35691/dwds/src/injected/client.js:11479:9)
at _EventStreamSubscription_onData_closure.call (http://localhost:35691/dwds/src/injected/client.js:17334:30)
at StaticClosure._rootRunUnary [as call] (http://localhost:35691/dwds/src/injected/client.js:4158:16)
at _CustomZone.runUnary (http://localhost:35691/dwds/src/injected/client.js:12326:39)
at _CustomZone.runUnaryGuarded (http://localhost:35691/dwds/src/injected/client.js:12258:14)
at _CustomZone_bindUnaryCallbackGuarded_closure.call (http://localhost:35691/dwds/src/injected/client.js:12461:25)
at invokeClosure (http://localhost:35691/dwds/src/injected/client.js:1205:26)
at EventSource.<anonymous> (http://localhost:35691/dwds/src/injected/client.js:1224:18)
看来是 Chrome 更改导致的问题已通过 Dart SDK 中的更改得到解决。
A flutter upgrade
将为您提供可解决此错误的最新 Dark SDK。
More information on the SDK update 在 Github