Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank Ā© 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
[Compiler Bug]: Coverage report shows missing branch coverage | GoodFirstPicks

[Compiler Bug]: Coverage report shows missing branch coverage

facebook/react 28 comments 25d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeTest focusedReactJavaScriptTypeScript

Why this is a good first issue

Coverage reporting issue related to compiler transformations.

AI Summary

The issue involves incorrect coverage reports when using the React compiler, likely due to how it transforms and memoizes component code. The fix may require changes to how generated code is handled in source maps or coverage tools. The exact implementation details are unclear, and it may involve understanding compiler internals.

Issue Description

What kind of issue is this?

  • React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
  • babel-plugin-react-compiler (build issue installing or using the Babel plugin)
  • eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
  • react-compiler-healthcheck (build issue installing or using the healthcheck script)

Link to repro

https://github.com/ValentinGurkov/vitest-react-compiler-missing-coverage-repro

Repro steps

Describe the bug

Hello,

I've been testing out the new React compiler and have noticed that the code coverage report becomes incorrect with the compiler turned it. I believe it may be related to the way it changes the output react component code.

I've created a minimal reproduction repository to demonstrate the issue: šŸ‘‰ https://github.com/ValentinGurkov/vitest-react-compiler-missing-coverage-repro, but I also want to share my findings here:

The button we are going to test is a simple one:

export const Button = () => {
    return <button>Click me</button>;
};

As well as its test:

import { page } from '@vitest/browser/context';
import { Button } from '@repo/components/ui/button.js';
import { describe, expect, it} from 'vitest';
import { render } from 'vitest-browser-react';

describe(Button, () => {
    it('renders with default variants', async () => {
        render(<Button />);

        const button = page.getByRole('button', { name: 'Click me' });

        await expect.element(button).toBeInTheDocument();
    });
});

The coverage report with the React compiler turned on looks like:

   āœ“  browser (chromium)  test/components/ui/button.test.tsx (1 test) 9ms
   āœ“ Button > renders with default variants 9ms

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  20:34:46
   Duration  632ms (transform 0ms, setup 133ms, collect 28ms, tests 9ms, environment 0ms, prepare 93ms)

 % Coverage report from v8
------------|

GitHub Labels

Type: BugStatus: UnconfirmedComponent: React Compiler

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • source maps
  • compiler internals
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedyes