英文:
Bugfender: ReferenceError: Can't find variable: BroadcastChannel
问题
我在我的Vue.js应用程序中使用Bugfender,在Chrome中运行正常,但在我的Safari Mac中不起作用。
Safari版本15.3(17612.4.9.1.5)
@bugfender/sdk: 2.2.2
浏览器控制台中的错误:ReferenceError: 找不到变量:BroadcastChannel
我已经回溯了这个问题,它来自bugfender/sdk/lib/index.js
有没有人遇到类似的问题?
英文:
I am using bugfender in my vue js application, which works fine in Chrome but doesn't work in my Safari Mac.
Safari Version 15.3 (17612.4.9.1.5)
@bugfender/sdk: 2.2.2
Error in browser console: ReferenceError: Can't find variable: BroadcastChannel
I did backtrack this issue and it's from bugfender/sdk/lib/index.js
Has anyone face the similar issue?
答案1
得分: 3
BroadcastChannel
只支持 Safari 15.4 及以上版本。参考链接:https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
如果你想在 Safari 15.3 及更早的版本中使用,请使用以下代码:
import { BroadcastChannel } from 'broadcast-channel';
Object.assign(window, { BroadcastChannel })
你必须在所有其他脚本之前运行这个脚本
英文:
BroadcastChannel
only supports safari from 15.4 and up. Reference: https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
if you want use in safari 15.3 down. Use:
import { BroadcastChannel } from 'broadcast-channel'
Object.assign(window, { BroadcastChannel })
> you must run this script before all
答案2
得分: 1
升级 @bugfender/sdk 到 2.2.3,这将在较旧的 Safari 版本中正常工作。
英文:
Upgrade @bugfender/sdk to 2.2.3 and this will work in older safari version.
答案3
得分: 0
不要将 broadcast-channel 添加到 window,请查看屏幕
只需添加这个 polyfill
https://github.com/JSmith01/broadcastchannel-polyfill/blob/master/index.js
英文:
@Tachibana Shin,
don't add broadcast-channel to window, look at the screen
just add the polyfill
https://github.com/JSmith01/broadcastchannel-polyfill/blob/master/index.js
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论