Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

vscode has issues with Inline Souremap Encoding  #120

@t83714

Description

@t83714

Currently, the inline sourcemap generated by @std/esm is not in base64 encoding.
Here is one example:

data:application/json;charset=utf-8,%7B%22version%22:3,%22sources%22:%5B%22/Users/user/Development/node_modules/xyz/index.js%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAAA%22%7D

It seems vscode & chrome inpsector debugger will always assume a data URI for the inline sourcemap is in base64 encoding (even if the ;base64 extension is not included in the data URI scheme).

This will lead to data decoding error. e.g. vscode will report error similart to this:

SourceMaps.getMapForGeneratedPath: exception while processing path: /Users/user/Development/node_modules/toyrobotsimulator/index.js, sourcemap: data:application/json;charset=utf-8,%7B%22version%22:3,%22sources%22:%5B%22/Users/user/Development/node_modules/xyz/index.js%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAAA%22%7D
SyntaxError: Unexpected token � in JSON at position 0
    at JSON.parse (<anonymous>)

Could we please change the inline sourcemap encoding to base64?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions