hnswlib-wasm icon indicating copy to clipboard operation
hnswlib-wasm copied to clipboard

import() is disallowed on ServiceWorkerGlobalScope by the HTML specification.

Open davidtbo opened this issue 1 year ago • 3 comments

Hello,

I'm trying to use your package to run hnswlib in a Chrome extension's background script. When I call loadHnswlib I get the error:

import() is disallowed on ServiceWorkerGlobalScope by the HTML specification.

Note that I don't get this error when importing transformers.js and it's successfully working in the background script, so it's not generally failing to do imports.

Any idea why your module might be different? I'm stumped why one module would import and work but not another, given this error message.

davidtbo avatar Jul 08 '23 19:07 davidtbo