Skip to content

fix(core): Iterator#map is only available on Node 22+#2923

Merged
SoonIter merged 1 commit intoweb-infra-dev:mainfrom
JounQin:fix/node_compatibility
Dec 24, 2025
Merged

fix(core): Iterator#map is only available on Node 22+#2923
SoonIter merged 1 commit intoweb-infra-dev:mainfrom
JounQin:fix/node_compatibility

Conversation

@JounQin
Copy link
Copy Markdown
Collaborator

@JounQin JounQin commented Dec 24, 2025

Summary

Iterator#map is only available on Node 22+ which is incompatible with rspress's baseline >=18.0.0

Related Issue

N/A

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings December 24, 2025 05:36
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 24, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit e6b633e
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/694b7beda237930008eb0033
😎 Deploy Preview https://deploy-preview-2923--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a Node.js version compatibility issue by replacing the use of Iterator#map (only available in Node 22+) with a standard array map method. The change ensures compatibility with the project's minimum Node.js version requirement of >=18.0.0.

Key Changes

  • Converts Set.values() to an array before calling map() to avoid using the Node 22+ exclusive Iterator#map method
  • Maintains identical functionality while supporting Node 18+

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SoonIter
Copy link
Copy Markdown
Member

@Timeless0911 How can I ensure that the output compiled by Rslib corresponds to my engines field?

@SoonIter SoonIter changed the title fix: Iterator#map is only available on Node 22+ fix(core): Iterator#map is only available on Node 22+ Dec 24, 2025
@SoonIter SoonIter merged commit 2c4e166 into web-infra-dev:main Dec 24, 2025
17 checks passed
@JounQin JounQin deleted the fix/node_compatibility branch December 24, 2025 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants