Open silentiumNoxe opened 3 years ago
The standard UMD header does not work within Shared Workers. Shared Workers run in a browser, however, these do not have access to window.
window
if (typeof exports !== "undefined" && exports !== null) { exports.Stomp = Stomp; } if (typeof window !== "undefined" && window !== null) { window.Stomp = Stomp; } else if (!exports) { self.Stomp = Stomp; }
The above block would give undefined exports.
undefined exports
To fix this problem, please define the following before including stompjs.
self.exports = {};
Edited the issue to make it like documentation.
Yes, it works. can use it as below: var stompClient = exports.Stomp.over(socket);
Thank you, @silentiumNoxe
The standard UMD header does not work within Shared Workers. Shared Workers run in a browser, however, these do not have access to
window
.The above block would give
undefined exports
.To fix this problem, please define the following before including stompjs.