Skip to content

getDocNodes() handles sourceMappingURL poorly, causes bad requests to esm.sh #2739

@mootari

Description

@mootari

Describe the bug

@deno/doc/doc also passes sourceMappingURL specifiers to the resolver. If these are relative then they won't be prefixed with ".", which causes the createResolver callback to treat them as absolute paths (see source).

Example (https://esm.sh/effect-web-midi@0.2.1/dist-types/index.d.ts):

export * from './src/index.d.ts';
//# sourceMappingURL=index.d.ts.map

causes a request to be made to https://esm.sh/index.d.ts.map which results in a 400 response.

Additional context

I haven't investigated how the result of getDocNodes gets processed. If source maps have no value, then it may be desirable to simply skip any specifier that ends in .map.

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending triageNew issue waiting for initial maintainer triage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions