Skip to content

d2js : in chrome, top-level await doesn't work with file:// URLs. #2601

Description

@bo-ku-ra
protocol firefox chrome edge(chromium)
file:// OK NG NG
http(s):// OK OK OK

mermaid supports rendering diagrams from local files.
https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs

i hope d2 supports local files too.
https://esm.sh/@terrastruct/d2@nightly/es2022/d2.mjs

const d2 = new D2();
const result = await d2.compile(source);
const svg    = await d2.render(result.diagram, result.renderOptions);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions