Description
An error for each auto fill group item is produced during population of form items.
Error produced:
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:
TypeError: null: type 'JSNull' is not a subtype of type 'String'
at Object.wrapException (http://localhost:49430/dwds/src/injected/client.js:1249:43)
at Object._asString (http://localhost:49430/dwds/src/injected/client.js:2823:15)
at main__closure7.call$1 (http://localhost:49430/dwds/src/injected/client.js:26887:54)
at _EventStreamSubscription_closure.call$1 (http://localhost:49430/dwds/src/injected/client.js:26250:26)
at StaticClosure._rootRunUnary (http://localhost:49430/dwds/src/injected/client.js:4365:16)
at _CustomZone.runUnary$2$2 (http://localhost:49430/dwds/src/injected/client.js:14412:39)
at _CustomZone.runUnaryGuarded$1$2 (http://localhost:49430/dwds/src/injected/client.js:14359:14)
at _CustomZone_bindUnaryCallbackGuarded_closure.call$1 (http://localhost:49430/dwds/src/injected/client.js:14546:25)
at _callDartFunctionFast1 (http://localhost:49430/dwds/src/injected/client.js:7871:25)
at http://localhost:49430/dwds/src/injected/client.js:7847:18
min code in flutter:
/////
class MyWidget extends StatefulWidget {
@OverRide
_MyWidgetState createState() => _MyWidgetState();
}
class _MyWidgetState extends State {
final _formKey = GlobalKey();
final _usernameController = TextEditingController();
final _passwordController = TextEditingController();
@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Auto-fill Example'),
),
body: Form(
key: _formKey,
child: AutofillGroup(
child: Column(
children: [
TextFormField(
controller: _usernameController,
autofillHints: [AutofillHints.username],
decoration: InputDecoration(
labelText: 'Username',
),
),
TextFormField(
controller: _passwordController,
autofillHints: [AutofillHints.password],
obscureText: true,
decoration: InputDecoration(
labelText: 'Password',
),
),
ElevatedButton(
onPressed: () {
if (_formKey.currentState.validate()) {
TextInput.finishAutofillContext();
// Submit form
}
},
child: Text('Submit'),
),
],
),
),
),
);
}
}
////
to reproduce: use the form once. restart the browser and use the form again. items are populated but error is produced for each item.
flutter doctor --verbose
[√] Flutter (Channel master, 3.28.0-2.0.pre.38596, on Microsoft Windows [Version 10.0.26100.2605], locale en-GB)
• Flutter version 3.28.0-2.0.pre.38596 on channel master at A:\appdev\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision dbf9e32879 (2 weeks ago), 2025-01-02 18:23:10 -0800
• Engine revision dbf9e32879
• Dart version 3.7.0 (build 3.7.0-267.0.dev)
• DevTools version 2.41.0
[√] Windows Version (11 Pro 64-bit, 24H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Android\Android\sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_SDK_ROOT = C:\Android\Android\sdk
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk"
.
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
• All Android licenses accepted.
[√] Chrome - develop for the web
• CHROME_EXECUTABLE = C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe
[√] Android Studio (version 2024.2)
• Android Studio at C:\Program Files\Android\Android Studio
• 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 21.0.3+-12282718-b509.11)
[√] VS Code (version 1.96.0)
• VS Code at C:\Users\Lewy\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.102.0
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • unknown
• Edge (web) • edge • web-javascript • Microsoft Edge 131.0.2903.146
[√] Network resources
• All expected network resources are available.