开发者问题收集

Flutter firebase 托管错误-未捕获的 TypeError:无法读取 null 的属性(读取“gCr”)

2022-06-06
465

在完成firebase hosting后没有任何错误,我进入网站发现这个错误,但我不知道解决办法

这是错误

Uncaught TypeError: Cannot read properties of null (reading 'gCr')
at main.dart.js:43863:27
at ara.a (main.dart.js:5471:62)
at ara.$2 (main.dart.js:35989:14)
at aor.$1 (main.dart.js:35983:21)
at amc.ajB (main.dart.js:36791:34)
at amc.u2 (main.dart.js:36793:21)
at ajT.$0 (main.dart.js:36375:11)
at Object.x8 (main.dart.js:5584:40)
at a6.o3 (main.dart.js:36308:3)
at Rh.dq (main.dart.js:35978:8)
2个回答

我运行:

flutter clean -df

删除旧版本,然后

flutter pub get  
flutter build web --release
firebase deploy

并且成功了。

Kwangeon Kim
2023-02-11

确保部署文件夹是 build/web plus

collo54
2022-06-07