Skip to content

v20.19.0 release notes - outdated messaging #57517

@alexsch01

Description

@alexsch01

Regarding this sentence in https://github.com/nodejs/node/releases/tag/v20.19.0

When the Node.js instance encounters a native ES module in require() somewhere outside node_modules for the first
time, it will emit an experimental warning unless require() comes from a path that contains node_modules.

This is not true in v20.19.0 due to

[[de313b2336](https://github.com/nodejs/node/commit/de313b2336)] - (SEMVER-MINOR) module: only emit
require(esm) warning under --trace-require-module (Joyee Cheung) https://github.com/nodejs/node/pull/56194

Test.mjs

export default class Test {}

main.cjs

console.log(process.version, require('./Test.mjs'))

$ node main.cjs
v20.19.0 [Module: null prototype] { __esModule: true, default: [class Test] }

Am I missing the point of the original sentence?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions