Title: module: fix extensionless entry with explicit type=commonjs by inoway46 · Pull Request #61600 · nodejs/node · GitHub
Open Graph Title: module: fix extensionless entry with explicit type=commonjs by inoway46 · Pull Request #61600 · nodejs/node
X Title: module: fix extensionless entry with explicit type=commonjs by inoway46 · Pull Request #61600 · nodejs/node
Description: When an extensionless entry point contains ESM syntax but is in a package with "type": "commonjs" in package.json, the module would silently exit with code 0 without executing or showing any error. This happened because extensionless files skip the .js suffix check in the CJS loader, so the explicit type: commonjs was not being enforced, allowing ESM syntax to be silently delegated to ESM loading which never completed before the process exited. This change ensures the CJS loader treats extensionless entry points as commonjs when type is explicitly set to "commonjs" in package.json, forcing ESM syntax to surface as a SyntaxError instead of silently exiting. Fixes: #61104 Related: #61171 (alternative approach)
Open Graph Description: When an extensionless entry point contains ESM syntax but is in a package with "type": "commonjs" in package.json, the module would silently exit with code 0 without executing o...
X Description: When an extensionless entry point contains ESM syntax but is in a package with "type": "commonjs" in package.json, the module would silently exit with code 0 wit...
Opengraph URL: https://github.com/nodejs/node/pull/61600
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:12cf4501-e5e3-971f-9bd7-afa719adec6b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DC44:39CFC7:9A273:D4BF5:6A4C95D8 |
| html-safe-nonce | 86b2f17d24f6373e44188190994dd048fed0be62d6e4a64b8b2d7427a5b37cc2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzQ0OjM5Q0ZDNzo5QTI3MzpENEJGNTo2QTRDOTVEOCIsInZpc2l0b3JfaWQiOiI0OTQyMjQzNjM0MDcyMDMyNzI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 58ffe082fde783187b90c4b72aefdfb9f1d918c319cc9ba19d3d723a3dcd5dc2 |
| hovercard-subject-tag | pull_request:3230952346 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodejs/node/pull/61600/files |
| twitter:image | https://avatars.githubusercontent.com/u/65857152?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/65857152?s=400&v=4 |
| og:image:alt | When an extensionless entry point contains ESM syntax but is in a package with "type": "commonjs" in package.json, the module would silently exit with code 0 without executing o... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7a2dede45637df6b92ddcfe2a557e67d4b5854ae |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width