Skip to content

fix: resolve module resolution failure on Node.js v24#1472

Open
scuba3198 wants to merge 1 commit intoresponsively-org:mainfrom
scuba3198:fix/node-24-esm-resolution
Open

fix: resolve module resolution failure on Node.js v24#1472
scuba3198 wants to merge 1 commit intoresponsively-org:mainfrom
scuba3198:fix/node-24-esm-resolution

Conversation

@scuba3198
Copy link
Copy Markdown

@scuba3198 scuba3198 commented Feb 27, 2026

✨ Pull Request

📓 Referenced Issue

Fixes #1462

ℹ️ About the PR

When running with Node.js v24, the postinstall script fails with a module resolution error (\ERR_MODULE_NOT_FOUND) because Node.js v24's ESM loader enforces strict file extension requirements for imports in transpiled TypeScript files.

Instead of modifying the source code to add non-standard file extensions (which would require newer TypeScript versions and potentially break older environments), this PR implements a robust server-side solution:

  1. Forced CommonJS Mode: Added \TS_NODE_ESM=false\ to all relevant build and post-install scripts in \desktop-app/package.json.
  2. CJS Register: Standardized \ s-node\ calls to use the CommonJS register (
    ode -r ts-node/register).

This ensures that \ s-node\ always operates in CommonJS mode, which natively supports extensionless resolution on all Node.js versions (including Node v24). This provides a clean, backward-compatible fix without changing a single line of application source code or \ sconfig.json.

🖼️ Testing Scenarios / Screenshots

Verfication:

  • Node v24 (Local): Verified that the webpack DLL build (\yarn run postinstall) now succeeds without \ERR_MODULE_NOT_FOUND.
  • Node 16 (CI): Confirmed that this approach does not use newer TypeScript flags like \�llowImportingTsExtensions, ensuring consistency and passability in existing CI pipelines.
  • DCO/CLA: All commits are signed-off.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 27, 2026

CLA assistant check
All committers have signed the CLA.

@scuba3198 scuba3198 force-pushed the fix/node-24-esm-resolution branch from 27ba8ca to b7a5117 Compare February 27, 2026 10:29
- Force CommonJS mode for ts-node using TS_NODE_ESM=false in package.json scripts.
- This bypasses Node v24's ESM loader which enforces strict extension requirements, resolving ERR_MODULE_NOT_FOUND.
- Avoids non-standard file extensions in imports, maintaining compatibility with legacy TypeScript and CI environments (Node 16).

Fixes responsively-org#1462

Signed-off-by: Mumukshu D.C <phoenixrising656@gmail.com>
@scuba3198 scuba3198 force-pushed the fix/node-24-esm-resolution branch from b7a5117 to b5ba3de Compare February 27, 2026 10:37
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.

[Bug] Installation fails with Node.js v24: ERR_MODULE_NOT_FOUND in webpack config

2 participants