Skip to content

Malformed source URLs in source map cache on Windows #1769

@PaperStrike

Description

@PaperStrike

Search Terms

v8 coverage, coverage, source map windows

Expected Behavior

The sources field of the generated source map cache consists of file URLs (e.g., file:///D:/Example/index.ts).

Actual Behavior

Some generated sources field contain malformed file paths (e.g., d:/Example/index.ts).
I think it "malformed" because the disk letter, along with :, is treated like a protocol. At least, it should be in upper case. It will be better if it follows the file:/// prefix like the others.

Steps to reproduce the problem

  1. Enable Node.js coverage output by setting NODE_V8_COVERAGE
  2. Run any .ts file with ts-node
  3. Compare the sources fields in each produced coverage output file with each other.

Minimal reproduction

https://github.com/PaperStrike/ts-node-bug-repro
The workflow does basically the steps above, and prints the malformed URLs.

Specifications

  • ts-node version: 10.8.0
  • node version: 16.15.0
  • TypeScript version: 4.6.4
  • Operating system and version: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions