matrix-js-sdk icon indicating copy to clipboard operation
matrix-js-sdk copied to clipboard

Can't import the sdk inside a service worker

Open clmnin opened this issue 3 years ago • 1 comments

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.

clmnin avatar Apr 04 '22 13:04 clmnin

Related https://github.com/matrix-org/matrix-js-sdk/issues/801

t3chguy avatar Apr 08 '22 09:04 t3chguy