openedx / openedx/paragon

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

Open
#4,141 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
140
Forks
100
Avg merge
1h 3m
Merged PRs (30d)
30

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with .nvmrc and .husky/pre-commit, then compare an actual git commit with npm run eslint, npx lint-staged, and sh .husky/pre-commit under Node 24. Trace the eslint-plugin-react failure in the hook context and determine whether the hook can be fixed or should be removed; done means commits no longer crash and the chosen behavior is verified against the existing CI checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript, node.js, react, typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.