Skip to content

Remove --no-experimental-require-module from node.options#256379

Merged
patrykkopycinski merged 4 commits intoelastic:mainfrom
patrykkopycinski:remove-no-experimental-require-module
Mar 13, 2026
Merged

Remove --no-experimental-require-module from node.options#256379
patrykkopycinski merged 4 commits intoelastic:mainfrom
patrykkopycinski:remove-no-experimental-require-module

Conversation

@patrykkopycinski
Copy link
Copy Markdown
Contributor

@patrykkopycinski patrykkopycinski commented Mar 6, 2026

Summary

Removes the --no-experimental-require-module flag from config/node.options.

The require(esm) feature has been enabled by default since Node.js v22.12.0 (December 2024) and has been the default behavior across 10+ LTS patch releases. On Node 22.22.0 (our current version per .nvmrc), this opt-out flag is no longer necessary.

Background

  • The flag was added when require(esm) was still behind --experimental-require-module and considered unstable.
  • Since v22.12.0, the feature is enabled by default — --no-experimental-require-module actively disables it.
  • ~95% of ESM-only npm packages work with require(esm). The only limitation is modules with top-level await (which throw ERR_REQUIRE_ASYNC_MODULE).

Risk

Low — this restores the Node.js default behavior that has been shipping for over a year in LTS releases. Any ESM-related issues would have been surfaced across the broader Node ecosystem by now.

Test plan

  • CI passes without the flag (validates no Kibana code depends on the old ERR_REQUIRE_ESM behavior)

Made with Cursor

Summary by CodeRabbit

  • Chores
    • Updated build and development scripts to remove an experimental Node.js configuration flag across all npm scripts, including build, start, lint, and test commands. This simplifies the development and build process while maintaining all existing functionality.

The `require(esm)` feature has been enabled by default since Node.js
v22.12.0 (December 2024) and has been stable across 10+ LTS patch
releases. The `--no-experimental-require-module` opt-out flag is no
longer necessary on Node 22.22.0.
@patrykkopycinski
Copy link
Copy Markdown
Contributor Author

/ci

Remove the flag from:
- package.json npm scripts
- .buildkite/scripts/steps/test/jest_parallel.sh
- src/cli/kibana/dev.js (require_module warning)
- kbn-mcp-dev-server CI check commands, tests, and README
@patrykkopycinski
Copy link
Copy Markdown
Contributor Author

/ci

@patrykkopycinski patrykkopycinski marked this pull request as ready for review March 6, 2026 08:01
@patrykkopycinski patrykkopycinski requested review from a team as code owners March 6, 2026 08:01
@tylersmalley tylersmalley added the reviewer:coderabbit PR review with CodeRabbit label Mar 6, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

1 similar comment
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 56ae2cbb-9369-422e-8131-2ec5af09583c

📥 Commits

Reviewing files that changed from the base of the PR and between cc30531 and 4915f4f.

📒 Files selected for processing (7)
  • .buildkite/scripts/steps/test/jest_parallel.sh
  • config/node.options
  • package.json
  • src/cli/kibana/dev.js
  • src/platform/packages/shared/kbn-mcp-dev-server/README.md
  • src/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.test.ts
  • src/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.ts
💤 Files with no reviewable changes (2)
  • src/cli/kibana/dev.js
  • config/node.options

📝 Walkthrough

Walkthrough

The pull request removes the --no-experimental-require-module flag from Node.js invocations across build scripts, package.json scripts, CI commands, and configuration files, simplifying command execution without altering functionality.

Changes

Cohort / File(s) Summary
Build and Test Configuration
.buildkite/scripts/steps/test/jest_parallel.sh, config/node.options
Removed the --no-experimental-require-module flag from Node options in Jest parallel runner and deleted the corresponding configuration section disabling ES module support.
Package Scripts
package.json
Stripped --no-experimental-require-module flag from 17+ npm scripts including build, debug, lint:*, start, storybook, test commands, and others, simplifying Node invocations while preserving script functionality.
Application Code
src/cli/kibana/dev.js
Removed the runtime warning block that alerted when Node.js experimental require_module support was enabled.
MCP Dev Server
src/platform/packages/shared/kbn-mcp-dev-server/README.md, src/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.ts, src/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.test.ts
Updated IDE configuration documentation and CI check commands to remove the legacy flag from build and linting invocations; updated test expectations accordingly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and accurately describes the primary change: removing the --no-experimental-require-module flag from node.options and related configuration files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 6, 2026

📝 Walkthrough

Walkthrough

The changes systematically remove the --no-experimental-require-module Node.js flag from configuration files, npm scripts, CI/CD pipelines, development tools, and runtime code. This includes updates to build scripts, development commands, linting, testing, and example documentation across the project.

Changes

Cohort / File(s) Summary
Configuration & Build Scripts
config/node.options, .buildkite/scripts/steps/test/jest_parallel.sh
Removed --no-experimental-require-module flag from Node.js options configuration and Jest parallel test runner invocation.
NPM Scripts
package.json
Removed --no-experimental-require-module prefix from 27+ npm script definitions, including build, debug, lint, start, storybook, and test commands.
Runtime Code
src/cli/kibana/dev.js
Removed runtime warning block that logged console notice when experimental ES modules feature was enabled.
MCP Dev Server
src/platform/packages/shared/kbn-mcp-dev-server/README.md, src/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.ts, src/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.test.ts
Removed flag from command examples, CI check invocations, and corresponding test expectations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: removing the --no-experimental-require-module flag from node.options, which is the primary objective across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/platform/packages/shared/kbn-mcp-dev-server/README.md (1)

28-28: Keep README startup command format consistent.

Line 28 uses node ./scripts/mcp_dev.js while Line 12 uses node scripts/mcp_dev. Consider using one canonical form to reduce copy/paste confusion.

Suggested doc tweak
-        "source \"$NVM_DIR/nvm.sh\" && cd ${KIBANA_WORKSPACE} && nvm use --silent && node ./scripts/mcp_dev.js"
+        "source \"$NVM_DIR/nvm.sh\" && cd ${KIBANA_WORKSPACE} && nvm use --silent && node scripts/mcp_dev"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platform/packages/shared/kbn-mcp-dev-server/README.md` at line 28, The
README contains two inconsistent startup command forms ("node
./scripts/mcp_dev.js" vs "node scripts/mcp_dev"); pick one canonical form and
update the other to match—e.g., change the occurrence of "node
./scripts/mcp_dev.js" to "node scripts/mcp_dev" (or vice versa) so both lines
use the same command format, ensuring the entries referencing the mcp_dev script
are identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/platform/packages/shared/kbn-mcp-dev-server/README.md`:
- Line 28: The README contains two inconsistent startup command forms ("node
./scripts/mcp_dev.js" vs "node scripts/mcp_dev"); pick one canonical form and
update the other to match—e.g., change the occurrence of "node
./scripts/mcp_dev.js" to "node scripts/mcp_dev" (or vice versa) so both lines
use the same command format, ensuring the entries referencing the mcp_dev script
are identical.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: da795806-41ba-4437-8b9f-2900665a5077

📥 Commits

Reviewing files that changed from the base of the PR and between cc30531 and 4915f4f.

📒 Files selected for processing (7)
  • .buildkite/scripts/steps/test/jest_parallel.sh
  • config/node.options
  • package.json
  • src/cli/kibana/dev.js
  • src/platform/packages/shared/kbn-mcp-dev-server/README.md
  • src/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.test.ts
  • src/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.ts
💤 Files with no reviewable changes (2)
  • src/cli/kibana/dev.js
  • config/node.options

@patrykkopycinski patrykkopycinski self-assigned this Mar 6, 2026
@patrykkopycinski patrykkopycinski added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Mar 6, 2026
@jbudz
Copy link
Copy Markdown
Contributor

jbudz commented Mar 9, 2026

Do you mind also backporting to 8.19? We'll be keeping the Node.js versions in sync between these branches for a while.

Copy link
Copy Markdown
Member

@qn895 qn895 left a comment

Choose a reason for hiding this comment

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

LGTM

@patrykkopycinski patrykkopycinski added backport:version Backport to applied version labels v9.4.0 v8.19.13 v9.3.3 and removed backport:skip This PR does not require backporting labels Mar 12, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #98 / Agent Builder agents Edit agent should edit agent name
  • [job] [logs] Scout: [ security / entity_store ] plugin / local-serverless-security_complete - Entity Store Main logs extraction - Should extract properly extract generic

Metrics [docs]

✅ unchanged

History

cc @patrykkopycinski

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 256379 locally
cc: @patrykkopycinski

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 256379 locally
cc: @patrykkopycinski

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 256379 locally
cc: @patrykkopycinski

3 similar comments
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 256379 locally
cc: @patrykkopycinski

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 256379 locally
cc: @patrykkopycinski

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 256379 locally
cc: @patrykkopycinski

jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
…6379)

## Summary

Removes the `--no-experimental-require-module` flag from
`config/node.options`.

The `require(esm)` feature has been **enabled by default since Node.js
v22.12.0** (December 2024) and has been the default behavior across 10+
LTS patch releases. On Node 22.22.0 (our current version per `.nvmrc`),
this opt-out flag is no longer necessary.

### Background

- The flag was added when `require(esm)` was still behind
`--experimental-require-module` and considered unstable.
- Since v22.12.0, the feature is enabled by default —
`--no-experimental-require-module` actively **disables** it.
- ~95% of ESM-only npm packages work with `require(esm)`. The only
limitation is modules with top-level `await` (which throw
`ERR_REQUIRE_ASYNC_MODULE`).

### Risk

Low — this restores the Node.js default behavior that has been shipping
for over a year in LTS releases. Any ESM-related issues would have been
surfaced across the broader Node ecosystem by now.

## Test plan

- [ ] CI passes without the flag (validates no Kibana code depends on
the old `ERR_REQUIRE_ESM` behavior)


Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated build and development scripts to remove an experimental
Node.js configuration flag across all npm scripts, including build,
start, lint, and test commands. This simplifies the development and
build process while maintaining all existing functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 256379 locally
cc: @patrykkopycinski

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 256379 locally
cc: @patrykkopycinski

patrykkopycinski added a commit to patrykkopycinski/kibana that referenced this pull request Mar 28, 2026
…6379)

Removes the `--no-experimental-require-module` flag from
`config/node.options`.

The `require(esm)` feature has been **enabled by default since Node.js
v22.12.0** (December 2024) and has been the default behavior across 10+
LTS patch releases. On Node 22.22.0 (our current version per `.nvmrc`),
this opt-out flag is no longer necessary.

- The flag was added when `require(esm)` was still behind
`--experimental-require-module` and considered unstable.
- Since v22.12.0, the feature is enabled by default —
`--no-experimental-require-module` actively **disables** it.
- ~95% of ESM-only npm packages work with `require(esm)`. The only
limitation is modules with top-level `await` (which throw
`ERR_REQUIRE_ASYNC_MODULE`).

Low — this restores the Node.js default behavior that has been shipping
for over a year in LTS releases. Any ESM-related issues would have been
surfaced across the broader Node ecosystem by now.

- [ ] CI passes without the flag (validates no Kibana code depends on
the old `ERR_REQUIRE_ESM` behavior)

Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **Chores**
* Updated build and development scripts to remove an experimental
Node.js configuration flag across all npm scripts, including build,
start, lint, and test commands. This simplifies the development and
build process while maintaining all existing functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 2c390fb)
patrykkopycinski added a commit to patrykkopycinski/kibana that referenced this pull request Mar 28, 2026
…6379)

Removes the `--no-experimental-require-module` flag from
`config/node.options`.

The `require(esm)` feature has been **enabled by default since Node.js
v22.12.0** (December 2024) and has been the default behavior across 10+
LTS patch releases. On Node 22.22.0 (our current version per `.nvmrc`),
this opt-out flag is no longer necessary.

- The flag was added when `require(esm)` was still behind
`--experimental-require-module` and considered unstable.
- Since v22.12.0, the feature is enabled by default —
`--no-experimental-require-module` actively **disables** it.
- ~95% of ESM-only npm packages work with `require(esm)`. The only
limitation is modules with top-level `await` (which throw
`ERR_REQUIRE_ASYNC_MODULE`).

Low — this restores the Node.js default behavior that has been shipping
for over a year in LTS releases. Any ESM-related issues would have been
surfaced across the broader Node ecosystem by now.

- [ ] CI passes without the flag (validates no Kibana code depends on
the old `ERR_REQUIRE_ESM` behavior)

Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **Chores**
* Updated build and development scripts to remove an experimental
Node.js configuration flag across all npm scripts, including build,
start, lint, and test commands. This simplifies the development and
build process while maintaining all existing functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 2c390fb)
@patrykkopycinski
Copy link
Copy Markdown
Contributor Author

💔 Some backports could not be created

Status Branch Result
9.3 An unhandled error occurred. Please see the logs for details
9.2 An unhandled error occurred. Please see the logs for details
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 256379

Questions ?

Please refer to the Backport tool documentation

patrykkopycinski added a commit to patrykkopycinski/kibana that referenced this pull request Mar 29, 2026
…6379)

## Summary

Removes the `--no-experimental-require-module` flag from
`config/node.options`.

The `require(esm)` feature has been **enabled by default since Node.js
v22.12.0** (December 2024) and has been the default behavior across 10+
LTS patch releases. On Node 22.22.0 (our current version per `.nvmrc`),
this opt-out flag is no longer necessary.

### Background

- The flag was added when `require(esm)` was still behind
`--experimental-require-module` and considered unstable.
- Since v22.12.0, the feature is enabled by default —
`--no-experimental-require-module` actively **disables** it.
- ~95% of ESM-only npm packages work with `require(esm)`. The only
limitation is modules with top-level `await` (which throw
`ERR_REQUIRE_ASYNC_MODULE`).

### Risk

Low — this restores the Node.js default behavior that has been shipping
for over a year in LTS releases. Any ESM-related issues would have been
surfaced across the broader Node ecosystem by now.

## Test plan

- [ ] CI passes without the flag (validates no Kibana code depends on
the old `ERR_REQUIRE_ESM` behavior)

Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated build and development scripts to remove an experimental
Node.js configuration flag across all npm scripts, including build,
start, lint, and test commands. This simplifies the development and
build process while maintaining all existing functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 2c390fb)

# Conflicts:
#	package.json
#	src/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.test.ts
@patrykkopycinski
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @patrykkopycinski

4 similar comments
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @patrykkopycinski

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @patrykkopycinski

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @patrykkopycinski

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @patrykkopycinski

patrykkopycinski added a commit that referenced this pull request Apr 6, 2026
…6379) (#260150)

## Summary

Backport of #256379 to 8.19.

Removes `--no-experimental-require-module` from:
- `config/node.options`
- All `package.json` scripts
- `.buildkite/scripts/steps/test/jest_parallel.sh` NODE_OPTIONS
- `src/cli/kibana/dev.js` (replaces the experimental module warning with
optional `--extended-stack-trace` debug helper)

## Test plan
- [ ] CI passes
- [ ] `yarn kbn bootstrap` succeeds locally
- [ ] `yarn start` works without `--no-experimental-require-module`

🤖 Generated with [Claude Code](https://claude.com/claude-code)
patrykkopycinski added a commit that referenced this pull request Apr 6, 2026
) (#260158)

# Backport

This will backport the following commits from `main` to `9.3`:
- [Remove --no-experimental-require-module from node.options
(#256379)](#256379)

<!--- Backport version: 11.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Patryk
Kopyciński","email":"contact@patrykkopycinski.com"},"sourceCommit":{"committedDate":"2026-03-13T06:12:57Z","message":"Remove
--no-experimental-require-module from node.options (#256379)\n\n##
Summary\n\nRemoves the `--no-experimental-require-module` flag
from\n`config/node.options`.\n\nThe `require(esm)` feature has been
**enabled by default since Node.js\nv22.12.0** (December 2024) and has
been the default behavior across 10+\nLTS patch releases. On Node
22.22.0 (our current version per `.nvmrc`),\nthis opt-out flag is no
longer necessary.\n\n### Background\n\n- The flag was added when
`require(esm)` was still behind\n`--experimental-require-module` and
considered unstable.\n- Since v22.12.0, the feature is enabled by
default —\n`--no-experimental-require-module` actively **disables**
it.\n- ~95% of ESM-only npm packages work with `require(esm)`. The
only\nlimitation is modules with top-level `await` (which
throw\n`ERR_REQUIRE_ASYNC_MODULE`).\n\n### Risk\n\nLow — this restores
the Node.js default behavior that has been shipping\nfor over a year in
LTS releases. Any ESM-related issues would have been\nsurfaced across
the broader Node ecosystem by now.\n\n## Test plan\n\n- [ ] CI passes
without the flag (validates no Kibana code depends on\nthe old
`ERR_REQUIRE_ESM` behavior)\n\n\nMade with
[Cursor](https://cursor.com)\n\n\n## Summary by CodeRabbit\n\n*
**Chores**\n* Updated build and development scripts to remove an
experimental\nNode.js configuration flag across all npm scripts,
including build,\nstart, lint, and test commands. This simplifies the
development and\nbuild process while maintaining all existing
functionality.\n","sha":"2c390fbf20944ccdd89b0d9c2036679cbe316ac3","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","backport:version","v9.4.0","v8.19.13","reviewer:coderabbit","v9.3.3"],"title":"Remove
--no-experimental-require-module from
node.options","number":256379,"url":"https://github.com/elastic/kibana/pull/256379","mergeCommit":{"message":"Remove
--no-experimental-require-module from node.options (#256379)\n\n##
Summary\n\nRemoves the `--no-experimental-require-module` flag
from\n`config/node.options`.\n\nThe `require(esm)` feature has been
**enabled by default since Node.js\nv22.12.0** (December 2024) and has
been the default behavior across 10+\nLTS patch releases. On Node
22.22.0 (our current version per `.nvmrc`),\nthis opt-out flag is no
longer necessary.\n\n### Background\n\n- The flag was added when
`require(esm)` was still behind\n`--experimental-require-module` and
considered unstable.\n- Since v22.12.0, the feature is enabled by
default —\n`--no-experimental-require-module` actively **disables**
it.\n- ~95% of ESM-only npm packages work with `require(esm)`. The
only\nlimitation is modules with top-level `await` (which
throw\n`ERR_REQUIRE_ASYNC_MODULE`).\n\n### Risk\n\nLow — this restores
the Node.js default behavior that has been shipping\nfor over a year in
LTS releases. Any ESM-related issues would have been\nsurfaced across
the broader Node ecosystem by now.\n\n## Test plan\n\n- [ ] CI passes
without the flag (validates no Kibana code depends on\nthe old
`ERR_REQUIRE_ESM` behavior)\n\n\nMade with
[Cursor](https://cursor.com)\n\n\n## Summary by CodeRabbit\n\n*
**Chores**\n* Updated build and development scripts to remove an
experimental\nNode.js configuration flag across all npm scripts,
including build,\nstart, lint, and test commands. This simplifies the
development and\nbuild process while maintaining all existing
functionality.\n","sha":"2c390fbf20944ccdd89b0d9c2036679cbe316ac3"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/256379","number":256379,"mergeCommit":{"message":"Remove
--no-experimental-require-module from node.options (#256379)\n\n##
Summary\n\nRemoves the `--no-experimental-require-module` flag
from\n`config/node.options`.\n\nThe `require(esm)` feature has been
**enabled by default since Node.js\nv22.12.0** (December 2024) and has
been the default behavior across 10+\nLTS patch releases. On Node
22.22.0 (our current version per `.nvmrc`),\nthis opt-out flag is no
longer necessary.\n\n### Background\n\n- The flag was added when
`require(esm)` was still behind\n`--experimental-require-module` and
considered unstable.\n- Since v22.12.0, the feature is enabled by
default —\n`--no-experimental-require-module` actively **disables**
it.\n- ~95% of ESM-only npm packages work with `require(esm)`. The
only\nlimitation is modules with top-level `await` (which
throw\n`ERR_REQUIRE_ASYNC_MODULE`).\n\n### Risk\n\nLow — this restores
the Node.js default behavior that has been shipping\nfor over a year in
LTS releases. Any ESM-related issues would have been\nsurfaced across
the broader Node ecosystem by now.\n\n## Test plan\n\n- [ ] CI passes
without the flag (validates no Kibana code depends on\nthe old
`ERR_REQUIRE_ESM` behavior)\n\n\nMade with
[Cursor](https://cursor.com)\n\n\n## Summary by CodeRabbit\n\n*
**Chores**\n* Updated build and development scripts to remove an
experimental\nNode.js configuration flag across all npm scripts,
including build,\nstart, lint, and test commands. This simplifies the
development and\nbuild process while maintaining all existing
functionality.\n","sha":"2c390fbf20944ccdd89b0d9c2036679cbe316ac3"}},{"branch":"8.19","label":"v8.19.13","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/260150","number":260150,"state":"OPEN"},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes reviewer:coderabbit PR review with CodeRabbit v8.19.13 v9.3.3 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants