I got following error when run flutter build web
"""
Compiling lib/main.dart for the Web...
Target dart2js failed: ProcessException: Process exited abnormally with exit code 1:
../../../.pub-cache/hosted/pub.dev/firebase_auth_web-5.8.13/lib/src/interop/auth_interop.dart:26:10:
Error: Type 'PromiseJsImpl' not found.
external PromiseJsImpl<void> applyActionCode(AuthJsImpl auth, String oobCode);
^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_auth_web-5.8.13/lib/src/interop/auth_interop.dart:38:10:
Error: Type 'PromiseJsImpl' not found.
external PromiseJsImpl<ActionCodeInfo> checkActionCode(
^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_auth_web-5.8.13/lib/src/interop/auth_interop.dart:42:10:
Error: Type 'PromiseJsImpl' not found.
external PromiseJsImpl<void> confirmPasswordReset(
^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_auth_web-5.8.13/lib/src/interop/auth_interop.dart:55:10:
Error: Type 'PromiseJsImpl' not found.
external PromiseJsImpl<void> setPersistence(
^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_storage_web-3.6.22/lib/src/interop/storage.dart:154:7:
Error: The method 'handleThenable' isn't defined for the class 'StorageReference'.
'StorageReference' is from 'package:firebase_storage_web/src/interop/storage.dart' ('../../../.pub-cache/hosted/pub.dev/firebase_storage_web-3.6.22/lib/src/interop/storage.dart').
handleThenable(storage_interop.list(jsObject, options?.jsObject))
^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_storage_web-3.6.22/lib/src/interop/storage.dart:169:7:
Error: The method 'handleThenable' isn't defined for the class 'StorageReference'.
'StorageReference' is from 'package:firebase_storage_web/src/interop/storage.dart' ('../../../.pub-cache/hosted/pub.dev/firebase_storage_web-3.6.22/lib/src/interop/storage.dart').
handleThenable(storage_interop.listAll(jsObject))
^^^^^^^^^^^^^^
"""
The pubspec.yaml
is
"""
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
share_plus: ^10.1.0
flutter_azure_tts: 0.2.3
http: ^1.0.0
flutter_dotenv: ^5.1.0
audio_service: ^0.18.12
just_audio: ^0.9.42
just_audio_web: ^0.4.13
rxdart: ^0.27.7
flutter_secure_storage: ^9.2.4
async: ^2.11.0
synchronized: ^3.1.0+1
scroll_to_index: ^3.0.1
audioplayers: ^6.1.0
flutter_markdown: ^0.6.10
cloud_firestore: ^4.16.1
firebase_auth: 4.12.0
firebase_core: ^2.25.2
firebase_storage: ^11.6.5
firebase_ui_auth: ^1.7.0
firebase_ui_oauth_google: ^1.2.10
google_sign_in: ^6.2.1
shared_preferences: ^2.0.0
pref: null
settings_ui: ^2.0.2
flutter_settings_screens: ^0.3.4
hive_flutter: ^1.0.0
printing: 5.12.0
pdf: ^3.10.0
"""
It works when flutter run main.dart.
I got following error when run flutter build web
"""
Compiling lib/main.dart for the Web...
Target dart2js failed: ProcessException: Process exited abnormally with exit code 1:
../../../.pub-cache/hosted/pub.dev/firebase_auth_web-5.8.13/lib/src/interop/auth_interop.dart:26:10:
Error: Type 'PromiseJsImpl' not found.
external PromiseJsImpl<void> applyActionCode(AuthJsImpl auth, String oobCode);
^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_auth_web-5.8.13/lib/src/interop/auth_interop.dart:38:10:
Error: Type 'PromiseJsImpl' not found.
external PromiseJsImpl<ActionCodeInfo> checkActionCode(
^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_auth_web-5.8.13/lib/src/interop/auth_interop.dart:42:10:
Error: Type 'PromiseJsImpl' not found.
external PromiseJsImpl<void> confirmPasswordReset(
^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_auth_web-5.8.13/lib/src/interop/auth_interop.dart:55:10:
Error: Type 'PromiseJsImpl' not found.
external PromiseJsImpl<void> setPersistence(
^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_storage_web-3.6.22/lib/src/interop/storage.dart:154:7:
Error: The method 'handleThenable' isn't defined for the class 'StorageReference'.
'StorageReference' is from 'package:firebase_storage_web/src/interop/storage.dart' ('../../../.pub-cache/hosted/pub.dev/firebase_storage_web-3.6.22/lib/src/interop/storage.dart').
handleThenable(storage_interop.list(jsObject, options?.jsObject))
^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/firebase_storage_web-3.6.22/lib/src/interop/storage.dart:169:7:
Error: The method 'handleThenable' isn't defined for the class 'StorageReference'.
'StorageReference' is from 'package:firebase_storage_web/src/interop/storage.dart' ('../../../.pub-cache/hosted/pub.dev/firebase_storage_web-3.6.22/lib/src/interop/storage.dart').
handleThenable(storage_interop.listAll(jsObject))
^^^^^^^^^^^^^^
"""
The pubspec.yaml
is
"""
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
share_plus: ^10.1.0
flutter_azure_tts: 0.2.3
http: ^1.0.0
flutter_dotenv: ^5.1.0
audio_service: ^0.18.12
just_audio: ^0.9.42
just_audio_web: ^0.4.13
rxdart: ^0.27.7
flutter_secure_storage: ^9.2.4
async: ^2.11.0
synchronized: ^3.1.0+1
scroll_to_index: ^3.0.1
audioplayers: ^6.1.0
flutter_markdown: ^0.6.10
cloud_firestore: ^4.16.1
firebase_auth: 4.12.0
firebase_core: ^2.25.2
firebase_storage: ^11.6.5
firebase_ui_auth: ^1.7.0
firebase_ui_oauth_google: ^1.2.10
google_sign_in: ^6.2.1
shared_preferences: ^2.0.0
pref: null
settings_ui: ^2.0.2
flutter_settings_screens: ^0.3.4
hive_flutter: ^1.0.0
printing: 5.12.0
pdf: ^3.10.0
"""
It works when flutter run main.dart.
Share Improve this question edited yesterday marc_s 755k184 gold badges1.4k silver badges1.5k bronze badges asked yesterday RyanRyan 112 bronze badges New contributor Ryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.1 Answer
Reset to default 0Run the following command to update all dependencies:
flutter pub upgrade --major-versions
Then, clean and rebuild:
flutter clean
flutter pub get
flutter build web