Skip to content

v20.19.0 release notes - outdated messaging #57517

Closed
@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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions