Skip to content

[8.19] Remove --no-experimental-require-module from node.options (#256379)#260150

Merged
patrykkopycinski merged 2 commits intoelastic:8.19from
patrykkopycinski:backport/8.19/pr-256379
Apr 6, 2026
Merged

[8.19] Remove --no-experimental-require-module from node.options (#256379)#260150
patrykkopycinski merged 2 commits intoelastic:8.19from
patrykkopycinski:backport/8.19/pr-256379

Conversation

@patrykkopycinski
Copy link
Copy Markdown
Contributor

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

@patrykkopycinski
Copy link
Copy Markdown
Contributor Author

/ci

@elasticmachine
Copy link
Copy Markdown
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

…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 patrykkopycinski force-pushed the backport/8.19/pr-256379 branch from d30616a to 47265f7 Compare March 28, 2026 22:55
@patrykkopycinski
Copy link
Copy Markdown
Contributor Author

/ci

@patrykkopycinski patrykkopycinski marked this pull request as ready for review March 29, 2026 00:33
@patrykkopycinski patrykkopycinski added the backport This PR is a backport of another PR label Mar 29, 2026
@patrykkopycinski patrykkopycinski enabled auto-merge (squash) March 29, 2026 05:12
@patrykkopycinski patrykkopycinski merged commit e38d4ae into elastic:8.19 Apr 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants