Title: module: throw error for ESM syntax in explicit commonjs entry by heathdutton · Pull Request #61171 · nodejs/node · GitHub
Open Graph Title: module: throw error for ESM syntax in explicit commonjs entry by heathdutton · Pull Request #61171 · nodejs/node
X Title: module: throw error for ESM syntax in explicit commonjs entry by heathdutton · Pull Request #61171 · nodejs/node
Description: When a main 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 the CJS loader detected ESM syntax, attempted to defer to ESM loading, but the async execution never completed before the process exited. This change throws ERR_REQUIRE_ESM for main modules with ESM syntax in explicitly CommonJS-typed packages, providing a clear error message instead of silent failure. Fixes: #61104
Open Graph Description: When a main 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 ...
X Description: When a main 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 execu...
Opengraph URL: https://github.com/nodejs/node/pull/61171
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:bf7cf1fb-30f0-ee03-de40-af1e0a4b83f0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EB72:345F55:12855DB:18E5B3F:6A4C6FBF |
| html-safe-nonce | 8cfe8d8172abe17f85dc0a41b76d2123bb5869dcba240762fdfc89ef87c03037 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjcyOjM0NUY1NToxMjg1NURCOjE4RTVCM0Y6NkE0QzZGQkYiLCJ2aXNpdG9yX2lkIjoiMjE5NzQ5NzU0MzIxNzkzNDI3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 95bf426fd849127d6301fcb9188a7aae2b579733ac32e495c845325a6cd94151 |
| hovercard-subject-tag | pull_request:3129503149 |
| 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/61171/files |
| twitter:image | https://avatars.githubusercontent.com/u/302215?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/302215?s=400&v=4 |
| og:image:alt | When a main 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 ... |
| 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 | 14099438da5379150f15a2892474c7c7e6c0e55e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width