Skip to content

Conversation

@alexismunoz1
Copy link

Summary

Fixes CLI startup failure on Node.js v24+

Problem

The CLI fails on Node.js v24 with:

Error: Dynamic require of "child_process" is not supported
    at file:///.../node_modules/@react-grab/claude-code/dist/cli.js:15:9

This occurs because cross-spawn uses dynamic require() for native Node modules, which ESM bundles don't support in Node.js v24.

Solution

  • Replace cross-spawn with native node:child_process spawn
  • Remove cross-spawn and @types/cross-spawn dependencies

The native spawn works identically for this use case (spawning the server process).

Testing

  • Tested on Node.js v24.7.0 (macOS Darwin 25.0.0)
  • CLI starts successfully and spawns the server process
  • Build completes without errors

Workaround for users

Use version 0.0.70: npx @react-grab/[email protected]

…ode.js v24 compatibility

The CLI was failing on Node.js v24 with:
"Error: Dynamic require of 'child_process' is not supported"

This occurred because cross-spawn uses dynamic require() for native Node
modules, which ESM bundles don't support in Node.js v24.

Changes:
- Replace cross-spawn with native node:child_process spawn
- Remove cross-spawn and @types/cross-spawn dependencies

Fixes CLI startup on Node.js v24+
@vercel
Copy link

vercel bot commented Dec 10, 2025

@alexismunoz1 is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@tt-a1i tt-a1i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The native spawn works fine here since it's just spawning node + a .js file, not a Windows .cmd wrapper. Makes sense to drop the extra dependency.

Copy link
Contributor

@tt-a1i tt-a1i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Withdrawing my earlier approval - want to take another look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants