Skip to content

pre-commit hook crashes when committing JS/TS files on Node 24 #4141

@brian-smith-tcril

Description

@brian-smith-tcril

Note: this issue was filed by Claude Code on behalf of @brian-smith-tcril while working on #3739.

Summary

The husky pre-commit hook crashes when committing any .js, .jsx, .ts, or .tsx file on Node 24. This affects all contributors using the Node version specified in .nvmrc.

Error

TypeError: Error while loading rule 'react/prefer-stateless-function': `[[GeneratorState]]` is not present on `O`
Occurred while linting <file>
    at Object.assert (node_modules/es-iterator-helpers/node_modules/internal-slot/index.js:23:10)
    at GeneratorStart (node_modules/es-iterator-helpers/aos/GeneratorStart.js:12:7)
    ...
    at mergeRules (node_modules/eslint-plugin-react/lib/util/Components.js:277:22)

What works vs. what doesn't

  • npm run eslint (what CI runs) — ✅ passes clean
  • npx lint-staged run manually — ✅ passes clean
  • Running the hook via sh .husky/pre-commit manually — ✅ passes clean
  • Committing via git commit — ❌ crashes

The crash is specific to the git hook execution environment. We haven't been able to fully reproduce it outside of an actual git commit. The root cause is likely an incompatibility between eslint-plugin-react and Node 24's native iterator protocol, but exactly why it only manifests in the hook context is unclear.

Workaround

git commit --no-verify

Proposal

Consider removing the pre-commit hooks entirely. CI already runs the full lint and type-check suite on every PR, so the pre-commit hook provides limited value while causing friction for contributors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions