fix(livewire): resolve Echo not found error due to lazy loading timing
This commit is contained in:
@@ -3,9 +3,7 @@ import Echo from 'laravel-echo';
|
||||
import Pusher from 'pusher-js';
|
||||
window.Pusher = Pusher;
|
||||
|
||||
window.startReverb = function () {
|
||||
if (window.Echo) return window.Echo;
|
||||
|
||||
if (document.querySelector('[data-requires-reverb]')) {
|
||||
window.Echo = new Echo({
|
||||
broadcaster: 'reverb',
|
||||
key: import.meta.env.VITE_REVERB_APP_KEY,
|
||||
@@ -15,6 +13,4 @@ window.startReverb = function () {
|
||||
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
|
||||
enabledTransports: ['ws', 'wss'],
|
||||
});
|
||||
|
||||
return window.Echo;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user