Remove --no-experimental-require-module from node.options#256379
Conversation
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.
|
/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
|
/ci |
✅ Actions performedReview triggered.
|
1 similar comment
✅ Actions performedReview triggered.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughThe pull request removes the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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). Comment |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThe changes systematically remove the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Comment |
There was a problem hiding this comment.
🧹 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.jswhile Line 12 usesnode 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
📒 Files selected for processing (7)
.buildkite/scripts/steps/test/jest_parallel.shconfig/node.optionspackage.jsonsrc/cli/kibana/dev.jssrc/platform/packages/shared/kbn-mcp-dev-server/README.mdsrc/platform/packages/shared/kbn-mcp-dev-server/src/tools/run_ci_checks.test.tssrc/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
|
Do you mind also backporting to 8.19? We'll be keeping the Node.js versions in sync between these branches for a while. |
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]
History
|
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
3 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…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 -->
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…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)
…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)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…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
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
|
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. |
4 similar comments
|
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. |
|
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. |
|
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. |
|
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. |
…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)
) (#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>
Summary
Removes the
--no-experimental-require-moduleflag fromconfig/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
require(esm)was still behind--experimental-require-moduleand considered unstable.--no-experimental-require-moduleactively disables it.require(esm). The only limitation is modules with top-levelawait(which throwERR_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
ERR_REQUIRE_ESMbehavior)Made with Cursor
Summary by CodeRabbit