Skip to content

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

Open
@davidtbo

Description

@davidtbo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions