matrix-js-sdk
matrix-js-sdk copied to clipboard
Can't import the sdk inside a service worker
Describe the bug If I simply import the SDK in a service worker, I get an error
import * as sdk from 'matrix-js-sdk';
Error
Uncaught ReferenceError: XMLHttpRequest is not defined
Expected behavior Importing the SDK should work
Additional context I'm trying to build a chrome extension, and so have to run the SDK in a background script or a service worker.
Related https://github.com/matrix-org/matrix-js-sdk/issues/801