Skip to content

ESM loading fails in the browser #26

Open
@KeithHenry

Description

@KeithHenry

Loading the module fails in the browser:
console log showing error

This fails because it attempts to fetch("markdown.wasm") which (because it's ESM loaded) gets resolved on the root path, not the path relative to the module.

So import * as markdown from "../{library}/markdown-wasm/dist/markdown.es.js"; should fetch("../{library}/markdown-wasm/dist/markdown.wasm")

It should use import.meta.url to resolve to the same path.

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