GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Could not report code coverage for file in sourcemap · Issue #55054 · nodejs/node

Could not report code coverage for file in sourcemap #55054

New issue
Copy link
New issue
Copy link
Closed
Closed
Could not report code coverage for file in sourcemap#55054
Copy link
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.coverageIssues and PRs related to Node.js code coverage support.Issues and PRs related to Node.js code coverage support.source mapsIssues and PRs related to source map support.Issues and PRs related to source map support.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.

Description

@avivkeller
avivkeller
opened on Sep 21, 2024
Issue body actions

Version

v22.9.0

Platform

N/A

Subsystem

test_runner

What steps will reproduce the bug?

Create index.mjs:

export {}
//# sourceMappingURL=index.mjs.map

Create index.mjs.map:

{"version":3,"file":"index.mjs","sourceRoot":"","sources":["index.mjs"],"names":[],"mappings":"AAEA"}

Run:

node --experimental-test-coverage --test index.mjs

How often does it reproduce? Is there a required condition?

Every time.

What is the expected behavior? Why is that the expected behavior?

Coverage should be reported, or an error explaining why it wasn't is displayed.

What do you see instead?

ℹ Warning: Could not report code coverage. TypeError: Cannot read properties of undefined (reading 'startOffset')

Additional information

CC @nodejs/test_runner

Reacted by Spencer Snyder

Activity

  1. avivkeller
    added
    confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.
    coverageIssues and PRs related to Node.js code coverage support.Issues and PRs related to Node.js code coverage support.
    source mapsIssues and PRs related to source map support.Issues and PRs related to source map support.
    test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
    on Sep 21, 2024
  2. geeksilva97 commented on Apr 21, 2025

    @geeksilva97
    geeksilva97
    on Apr 21, 2025
    Contributor
    More actions

    It's not reproducible in 23.10.0

    Reacted by Aviv Keller, Pietro Marchini and Tejas Sathe
  3. mcollina commented on May 23, 2026

    @mcollina
    mcollina
    on May 23, 2026
    SponsorMember
    More actions

    I investigated this from a clean upstream/main build and could not reproduce it anymore.

    I checked out upstream/main, rebuilt node, and then ran the exact repro from the issue:

    ./node --experimental-test-coverage --test /tmp/.../index.mjs

    with:

    export {}
    //# sourceMappingURL=index.mjs.map

    and:

    {"version":3,"file":"index.mjs","sourceRoot":"","sources":["index.mjs"],"names":[],"mappings":"AAEA"}

    Current behavior is a normal coverage report:

    • index.mjs | 100.00 | 100.00 | 100.00
    • exit code 0

    So this no longer fails with:

    Warning: Could not report code coverage. TypeError: Cannot read properties of undefined (reading 'startOffset')
    

    The most likely fix is #55359, which made coverage only use sourcemap remapping when --enable-source-maps is explicitly enabled. That matches this repro, because it only used --experimental-test-coverage and --test.

    There was also related hardening in #55055 for invalid or missing sourcemaps.

  4. mcollina
    closed this as completedon May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.coverageIssues and PRs related to Node.js code coverage support.Issues and PRs related to Node.js code coverage support.source mapsIssues and PRs related to source map support.Issues and PRs related to source map support.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.