首页 > 解决方案 > Chrome 69 不支持 Firebase SDK

问题描述

昨天一切正常,今天早上我注意到chrome正在引入一个新界面,后来我检查了chrome版本,现在更新到v69。到目前为止,一切都很好。然后我运行了连接到 firebase 的服务器。但我开始明白了:

09:46:30.598 index.esm.js?76ac:2069 Uncaught FirebaseError {code: "messaging/unsupported-browser", message: "Messaging: This browser doesn't support the API's …he firebase SDK. (messaging/unsupported-browser).", stack: "FirebaseError: Messaging: This browser doesn't sup….0.0.0:8000/index.js?d00bc69e0c69f561d4af:2672:1)"}code: "messaging/unsupported-browser"message: "Messaging: This browser doesn't support the API's required to use the firebase SDK. (messaging/unsupported-browser)."stack: "FirebaseError: Messaging: This browser doesn't support the API's required to use the firebase SDK. (messaging/unsupported-browser).
at Object.factoryMethod [as messaging] (webpack-internal:///311:2077:32)
at FirebaseAppImpl._getService (webpack-internal:///30:134:66)
at FirebaseAppImpl.(anonymous function) [as messaging] (webpack-internal:///30:323:31)
at Object.serviceNamespace [as messaging] (webpack-internal:///30:308:32)
at eval (webpack-internal:///66:51:36)
at Object.<anonymous> (http://0.0.0.0:8000/index.js?d00bc69e0c69f561d4af:1240:1)
at __webpack_require__ (http://0.0.0.0:8000/index.js?d00bc69e0c69f561d4af:708:30)
at fn (http://0.0.0.0:8000/index.js?d00bc69e0c69f561d4af:113:20)
at eval (webpack-internal:///286:55:11)
at Object.<anonymous> (http://0.0.0.0:8000/index.js?d00bc69e0c69f561d4af:2672:1)"__proto__: Error

长错误变短:Messaging: This browser doesn't support the API's required to use the firebase SDK

降级到 chrome 68 是一个解决方案,但有人有更好的主意吗?

编辑:

系统信息:Pop!_OS 18.04 LTS Linux(64 位)

Chrome 版本:69.0.3497.81(官方版本)(64 位)

节点版本:v10.9.0

编辑:

服务器在部署到生产环境和 Firefox 时工作得很好。

标签: firebasegoogle-chromefirebase-realtime-databasebrowser-support

解决方案


当您不使用 HTTPS 或localhost. 这记录在官方文档中:source

FCM SDK 仅在通过 HTTPS 提供的页面中受支持。这是由于它使用了仅在 HTTPS 站点上可用的服务工作者。

当然,您的问题是由于使用 0.0.0.0 而不是localhost.


推荐阅读