Is there an existing issue for this?
Which plugins are affected?
Auth
Which platforms are affected?
Web
Description
FirebaseAuth.instance.signInWithCustomToken(token) crashes on Flutter
web (dart2js) with "Unsupported operation: Int64 accessor not supported
by dart2js."
Root cause (found by reading the installed package source):
firebase_auth_platform_interface-9.0.6/lib/src/pigeon/messages.pigeon.dart,
_PigeonCodec.writeValue:
dart class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); // <-- unconditional, no kIsWeb guard } else if (value is ActionCodeInfoOperation) { ...
Any plain Dart int reaching this codec crashes on web, since
WriteBuffer.putInt64 isn't supported by dart2js.
Prior art: this is the same bug class as #17924
("cloud_functions_web: dartify() throws 'Int64 accessor not supported by
dart2js' when serializing callable function request"), closed 2026-03-04
after a kIsWeb-guarded fix (PR #18066) landed in cloud_functions. See
cloud_functions-6.3.6/lib/src/https_callable.dart:
dart dynamic _updateRawDataToList(dynamic value) { if (value is Uint8List || value is Int32List || // Int64List is not supported by dart2js, skip the check on web. (!kIsWeb && value is Int64List) || ...
That fix was scoped to cloud_functions only.
firebase_auth_platform_interface has the identical unguarded pattern in
its own generated pigeon codec and was apparently never covered by an
equivalent fix. I also spot-checked cloud_firestore_platform_interface's
pigeon codec (8.0.6) and found the same unguarded if (value is int)
pattern there too, though I have not reproduced an actual crash through
cloud_firestore — flagging it as a likely-affected sibling package in
case a shared/generated-code fix makes sense across all three rather than
patching each plugin individually.
Expected: signInWithCustomToken (and any other firebase_auth
pigeon-serialized call carrying an int) should work on web without
crashing — either by adding the same kIsWeb-guarded conversion used in
cloud_functions, or by avoiding raw int in the pigeon payload for web
builds.
### Reproducing the issue
1. Mint a Firebase custom token server-side, e.g. via the Admin SDK:
`admin.auth().createCustomToken(uid)`.
2. In a Flutter web app (release or profile build, i.e. dart2js — this
is a compile-target-specific bug, not reproducible in debug/JIT mode),
call:
`await FirebaseAuth.instance.signInWithCustomToken(token);`
3. Observe the crash below instead of a successful sign-in.
### Firebase Core version
4.13.0
### Flutter Version
Flutter 3.41.9 • channel stable Dart 3.11.5
### Relevant Log Output
```shell
switchToChildSession failed: Unsupported operation: Int64 accessor not supported by dart2js.
at Object.wrapException (main.dart.js:8448:47)
at NativeTypedData.setInt64$3 (main.dart.js:116592:15)
at WriteBuffer.putInt64$1 (main.dart.js:201711:32)
at _PigeonCodec.writeValue$2 (main.dart.js:185592:16)
at StandardMessageCodec_writeValue_closure.call$2 (main.dart.js:268561:10)
at JsLinkedHashMap.forEach$1 (main.dart.js:115808:16)
at _PigeonCodec.writeValue$2 (main.dart.js:268424:12)
at _PigeonCodec.writeValue$2 (main.dart.js:185594:14)
at _PigeonCodec.writeValue$2 (main.dart.js:268419:17)
at _PigeonCodec.writeValue$2 (main.dart.js:185594:14)
Flutter dependencies
Expand Flutter dependencies snippet
- audioplayers 5.2.1 [audioplayers_android audioplayers_darwin audioplayers_linux audioplayers_platform_interface audioplayers_web audioplayers_windows file flutter http meta path_provider synchronized uuid]
- battery_plus 4.1.0 [flutter flutter_web_plugins battery_plus_platform_interface meta upower]
- cloud_firestore 6.8.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cloud_functions 6.3.6 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter]
- connectivity_plus 5.0.2 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm]
- crypto 3.0.7 [typed_data]
- cupertino_icons 1.0.9
- excel 4.0.6 [archive xml collection equatable]
- file_picker 8.3.7 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32 cross_file web]
- firebase_auth 6.5.7 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 4.13.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_storage 13.4.6 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter mime]
- flutter_svg 2.2.4 [flutter http vector_graphics vector_graphics_codec vector_graphics_compiler]
- google_sign_in 6.3.0 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web]
- http 1.6.0 [async http_parser meta web]
- intl 0.20.2 [clock meta path]
- path_provider 2.1.5 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- qr_flutter 4.1.0 [flutter qr]
- shared_preferences 2.5.5 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- sign_in_with_apple 6.1.4 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web]
- three_js 0.0.1 [flutter three_js_math three_js_advanced_loaders three_js_animations three_js_controls three_js_core three_js_core_loaders three_js_curves three_js_simple_loaders three_js_text]
- timezone 0.9.4 [path]
- url_launcher 6.3.2 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- uuid 4.5.3 [crypto fixnum]
Additional context and comments
No response
Is there an existing issue for this?
Which plugins are affected?
Auth
Which platforms are affected?
Web
Description
FirebaseAuth.instance.signInWithCustomToken(token)crashes on Flutterweb (dart2js) with "Unsupported operation: Int64 accessor not supported
by dart2js."
Root cause (found by reading the installed package source):
firebase_auth_platform_interface-9.0.6/lib/src/pigeon/messages.pigeon.dart,_PigeonCodec.writeValue:
dart class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { if (value is int) { buffer.putUint8(4); buffer.putInt64(value); // <-- unconditional, no kIsWeb guard } else if (value is ActionCodeInfoOperation) { ... Any plain Dart
intreaching this codec crashes on web, sinceWriteBuffer.putInt64isn't supported by dart2js.Prior art: this is the same bug class as #17924
("cloud_functions_web: dartify() throws 'Int64 accessor not supported by
dart2js' when serializing callable function request"), closed 2026-03-04
after a
kIsWeb-guarded fix (PR #18066) landed incloud_functions. Seecloud_functions-6.3.6/lib/src/https_callable.dart:
dart dynamic _updateRawDataToList(dynamic value) { if (value is Uint8List || value is Int32List || // Int64List is not supported by dart2js, skip the check on web. (!kIsWeb && value is Int64List) || ... That fix was scoped to
cloud_functionsonly.firebase_auth_platform_interfacehas the identical unguarded pattern inits own generated pigeon codec and was apparently never covered by an
equivalent fix. I also spot-checked
cloud_firestore_platform_interface'spigeon codec (8.0.6) and found the same unguarded
if (value is int)pattern there too, though I have not reproduced an actual crash through
cloud_firestore— flagging it as a likely-affected sibling package incase a shared/generated-code fix makes sense across all three rather than
patching each plugin individually.
Expected:
signInWithCustomToken(and any otherfirebase_authpigeon-serialized call carrying an
int) should work on web withoutcrashing — either by adding the same
kIsWeb-guarded conversion used incloud_functions, or by avoiding rawintin the pigeon payload for webbuilds.
Flutter dependencies
Expand
Flutter dependenciessnippetAdditional context and comments
No response