Temporarily add "node" entries to exports in package.json files#5650
Merged
iclanton merged 8 commits intomicrosoft:mainfrom Feb 20, 2026
Merged
Conversation
The "import" condition in "exports" maps was added in 6d669f1, but it breaks scenarios where the lib-esm/ output doesn't exist or has incompatibilities. Remove all "import" entries from 78 published project package.json files to fix issue microsoft#5644.
bmiddha
approved these changes
Feb 19, 2026
dmichon-msft
approved these changes
Feb 19, 2026
This reverts commit 47b8e5f.
…#5644) The "import" condition in "exports" maps points to lib-esm/ files which have extensionless imports. Node.js ESM requires explicit .js extensions, so importing these packages from a "type": "module" project fails with ERR_MODULE_NOT_FOUND. Fix by adding a "node" condition before "import" in exports. Node.js matches "node" first and uses CJS (which handles extensionless requires), while bundlers skip "node" and use "import" for ESM. Also adds an esm-node-import-test build-test project to exercise this scenario.
…#5644) The "import" condition in "exports" maps points to lib-esm/ files which have extensionless imports. Node.js ESM requires explicit .js extensions, so importing these packages from a "type": "module" project fails with ERR_MODULE_NOT_FOUND. Fix by adding a "node" condition before "import" in exports. Node.js matches "node" first and uses CJS (which handles extensionless requires), while bundlers skip "node" and use "import" for ESM. Also adds an esm-node-import-test build-test project that exercises this scenario by spawning a Node.js ESM subprocess that imports @rushstack/node-core-library.
dmichon-msft
approved these changes
Feb 19, 2026
iclanton
added a commit
to iclanton/rushstack
that referenced
this pull request
Feb 20, 2026
…es (microsoft#5650)" This reverts commit 7e14cda.
iclanton
added a commit
to iclanton/rushstack
that referenced
this pull request
Feb 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mitigates #5644 for now.