Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
[Compiler Bug]: eslint-plugin-react-hooks silent bailout when try/catch/finally block in the same component body | GoodFirstPicks

[Compiler Bug]: eslint-plugin-react-hooks silent bailout when try/catch/finally block in the same component body

facebook/react 4 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeReactJavaScriptTypeScript

Why this is a good first issue

The issue involves a known compiler limitation with try/catch/finally blocks affecting linting behavior.

AI Summary

The issue reports that eslint-plugin-react-hooks fails to report errors when try/catch/finally blocks are present in a component. This is a known compiler limitation. The maintainer has acknowledged the issue and suggested an undocumented workaround, but the core problem requires compiler changes.

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-hooks (build issue installing or using the eslint plugin)
  • react-compiler-healthcheck (build issue installing or using the healthcheck script)

Link to repro

https://playground.react.dev/#N4Igzg9grgTgxgUxALhAHRFMCAEcA2AlggHYAuGaJVhAtgA4Qxk7A5YIAKAhjN7WBwBfHADMYEWjgwkEADzIB6EtwBuhAObcyhCNXQk6jZq3bYAsgloRhYiVIwwE3OBQNV5xlgBMEo7lD4LKJQJK66JDgAQlAaAEoI9BLeUOF6ABQAlKxUOHl4emAsTuoIAO4Akt44ALw4AHJQtABGCDDpHDx8AlkA2o4IpWUAtITeGAC6mVQzkflwhSyCdRyW1ulZtQB8OXP584UQ+AgAdPgQGuklxJXe03v7OIqKOOaEYGCEJBo4TmSwJAAhLl8kIADQ4XrXcpVKYghYkSDHM4XdJge77EF5MgwACeu0eB0RR1O50uGAAynRAtovj8FgxjnICuQJPgxOcyhgMaC8No4AALHDpNoSGDIdgkADWJAgZRI2WAWMeCKRp1FTBFMDFPLyIlEX24+Hw+KVD32qpJKPJIAAwsduCQoPRucqhLN9n8ATgADzeQiqLa2gUIOBSnBEchtHDQMj0KAsdIUgXQfDVVo4ACMOA1MAh7xwAAZMj7FP7A1QhCAwSAEQaNCgQEYmCwyLj6Lg2Jx8LEvgB5eg6Qq2cSSHAAcma3Fa+GG9B7Gi+wycLjIwwZ9EIxxgZfeZHHAG5ZukzXlnhut7S9OYIL4JRgjfhKCQRGBaWADQhBN3eyQB0PEUyA9q3AFNKijGAVHwMAUH8aCECEIA

Repro steps

  1. Install [email protected] (or latest).
  2. Create a React component with a clear rule violation (e.g., useMemo with no return value).
  3. Observe that the linter correctly reports the error.
  4. Add a try/catch or try/catch/finally block anywhere inside the component body.
  5. Bug: The linter stops reporting the useMemo error (and all other compiler errors) for that component. Note: In the React Playground, when recreating the example, I see that the the try/catch/finally block actually throws an error, but the useMemo one is still ignored

Expected Behavior

The linter should flag the useMemo error regardless of the try/catch block present in the component.

Actual Behavior

The linter reports 0 errors. Removing the try/catch block immediately causes the useMemo error to reappe

GitHub Labels

Type: BugStatus: Unconfirmed

Want to work on this?

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

Risk Flags

  • compiler limitation
  • undocumented feature
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno