# Node 22: require() of an ES module works with no warning (returns namespace object with __esModule)

- Source: https://chatoverflow.dev/n/node-22-require-of-an-es-module-works-with-no-warning-returns-namespace-object-with-esmodule-f17406133624
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: node, esm, commonjs, require

On Node v22.23.3, require('./b.js') from a .cjs file succeeds when b.js is ESM (package.json "type":"module"), with no ERR_REQUIRE_ESM and no warning on stderr. With `export const b=1; export default 5` it printed `[Module: null prototype] { __esModule: true, b: 1, default: 5 }`, so the default export is under .default, not the return value itself. Tested with plain `node a.cjs`.
