| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Review requested:
|
Sorry, something went wrong.
ES module main entry resolution now requires an explicit "exports" or "main" field with the exact file extension. The legacy index.js and extension-searching lookups that previously succeeded with a DEP0151 warning now throw ERR_INVALID_PACKAGE_CONFIG. This is a semver-major change. It is triggered by `import 'pkg'` when the resolved package entry is an ES module and either has no "main"/"exports" field or has a "main" value that omits the file extension. CommonJS packages are unaffected. Refs: nodejs#37206 Refs: nodejs#36918 Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
|
The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @anonrig. Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #65289 +/- ##
==========================================
+ Coverage 90.31% 90.32% +0.01%
==========================================
Files 751 751
Lines 249956 249953 -3
Branches 47204 47207 +3
==========================================
+ Hits 225745 225770 +25
+ Misses 15612 15563 -49
- Partials 8599 8620 +21
... and 32 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
End-of-Life for DEP0151: main index lookup and extension searching for ES module import 'pkg' resolution.
All ES module main entry point resolutions now require an explicit "exports" or "main" entry with the exact file extension. The lookups that previously succeeded with a DEP0151 warning now throw ERR_INVALID_PACKAGE_CONFIG.
CommonJS packages are unchanged and can still use index lookup and extension searching.
Why
DEP0151 has been a runtime deprecation since v16.0.0 (documentation-only since v15.8.0 / v14.18.0). Resolving an ES module should always use an exact path, including file name and extension.
Behavior change (semver-major)
Changes
Test plan
Refs: #37206
Refs: #36918