Skip to content

How to resolve import(npm: ...) protocol imports in standard library when using in Browser #94

@tomlarkworthy

Description

@tomlarkworthy

The standard library uses protocol prefixed imports, e.g.

export const svg = () => import("npm:htl").then((_) => _.svg);

Its not clear what the blessed path is on how these should resolve when using the NotebookRuntime in the browser.

Example: https://observablehq.com/@tomlarkworthy/basic-notebook-2-0-renderer-smoke-test

4 of 5 cells works except the svg`` tagged template fails because it can't load htl from the standard library. Leading to

RuntimeError: Failed to fetch dynamically imported module: npm:htl

I see resolveImport strips protocols in notebooks but its not applied in the standard library loading critical path?

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