Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CI with Node v23.1.0 #16932

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/babel-core/test/helpers/esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,16 @@ async function spawn(runner, filename, cwd = process.cwd()) {
process.execPath,
// pass `cwd` as params as `process.cwd()` will normalize `cwd` on macOS
[require.resolve(`../fixtures/babel-${runner}.mjs`), filename, cwd],
{ cwd, env: process.env },
{
cwd,
env: {
...process.env,
NODE_OPTIONS:
parseInt(process.versions.node) >= 23
? "--disable-warning=ExperimentalWarning"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does node 23.1 updated the error message? We already removed the experimental warning from stderr.

Plus if we provide other NODE_OPTIONS, this will replaced the provided options and with --disable-warning only.

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so node.js 23.1 updated the experimental warning: now they will print which file imports which module:

ExperimentalWarning: CommonJS module /home/runner/work/babel/babel/packages/babel-core/lib/config/files/module-types.js is loading ES Module /home/runner/work/babel/babel/packages/babel-core/test/fixtures/async/preset-mjs-native/preset.mjs using require().
    Support for loading ES Module in require() is an experimental feature and might change at any time
    (Use `node --trace-warnings ...` to show where the warning was created)

Could have updated the experimental warning regex so we will not accidentally miss unwanted experimental warnings.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you open another PR? 🙏

: "",
},
},
);

const EXPERIMENTAL_WARNING =
Expand Down
Loading