Skip to content

fix(deps): restore develop after corrupted node_modules / HMR ENOENT#452

Merged
jimmyandrade merged 1 commit into
mainfrom
fix/hmr-enoent-node-modules
Jul 16, 2026
Merged

fix(deps): restore develop after corrupted node_modules / HMR ENOENT#452
jimmyandrade merged 1 commit into
mainfrom
fix/hmr-enoent-node-modules

Conversation

@jimmyandrade

Copy link
Copy Markdown
Member

Summary

  • Recovers local gatsby develop when HMR reports dozens of ENOENT / Can't resolve errors for node_modules (and nested packages that stopped being hoisted).
  • Adds direct deps gatsby-link@2.11.0 and gatsby-react-router-scroll@3.7.0, npm override remark-mdx@1.6.22, and local plugin plugins/ensure-google-fonts-dirs (with tests).
  • Documents recovery in TROUBLESHOOTING.md.

Closes #451

Test plan

  • npm test — 29 suites green
  • npm run develop on Node 18 serves http://localhost:8001 with HTTP 200
  • Hard-refresh browser and confirm HMR no longer shows the 26 ENOENT module errors

Made with Cursor

Hoist gatsby-link and gatsby-react-router-scroll as direct deps so the
develop SSR bundle can resolve them, override remark-mdx to 1.6.22 to
avoid ERR_REQUIRE_ESM in gatsby-recipes, add a first-party plugin that
creates google-fonts cache dirs before prefetch-google-fonts, and
document the recovery path in TROUBLESHOOTING.md.

Closes #451

Co-authored-by: Cursor <cursoragent@cursor.com>
@jimmyandrade jimmyandrade added the bug Something isn't working label Jul 16, 2026
@jimmyandrade jimmyandrade self-assigned this Jul 16, 2026
@jimmyandrade
jimmyandrade merged commit 350881b into main Jul 16, 2026
4 checks passed
@jimmyandrade
jimmyandrade deleted the fix/hmr-enoent-node-modules branch July 16, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(dev): Gatsby HMR fails with ENOENT for missing node_modules files

1 participant