镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

v20.19.0 release notes - outdated messaging #57517

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?

Activity

  1. aduh95 commented on Mar 17, 2025

    @aduh95
    Contributor
  2. marco-ippolito commented on Mar 17, 2025

    @marco-ippolito
    Member

    Probably a mistake but I'll leave Joyee to re-word and then I'll update the release notes

  3. joyeecheung commented on Mar 17, 2025

    @joyeecheung
    Member

    Ah, yes, I wasn't thinking straight and got stuck with an older status when I proposed the changes to the release notes, sorry. The latest status should just be:

    This feature has been tested on v23.x and v22.x, and we are looking for user feedback from v20.x to make more final tweaks before fully stabilizing it. It now no longer emits a warning unless --trace-require-module is explicitly used. If there happens to be any regressions caused by this feature, users can report it to the Node.js issue tracker. Meanwhile this feature can also be disabled using --no-experimental-require-module as a workaround.

    Should I just update the changelog_v20.md and sync the rest (what are the rest, apart from the GitHub release notes and the blog?)

  4. marco-ippolito commented on Mar 17, 2025

    @marco-ippolito
    Member

    correct, thats it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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