fix: resolve module resolution failure on Node.js v24#1472
Open
scuba3198 wants to merge 1 commit intoresponsively-org:mainfrom
Open
fix: resolve module resolution failure on Node.js v24#1472scuba3198 wants to merge 1 commit intoresponsively-org:mainfrom
scuba3198 wants to merge 1 commit intoresponsively-org:mainfrom
Conversation
27ba8ca to
b7a5117
Compare
- 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>
b7a5117 to
b5ba3de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ 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:
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: