javascriptvue.jsbroadcast-channelbugfender

Bugfender: ReferenceError: Can't find variable: BroadcastChannel


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?


Solution

  • 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