The standard UMD header does not work within Shared Workers. Shared Workers run in a browser, however, these do not have access to 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.
To fix this problem, please define the following before including stompjs.
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.