fix(resolve): ignore null export targets#358
Conversation
Treat null package export targets as omitted when flattening exports for lookupNodeModuleSubpath. This avoids crashing while reverse-resolving package subpaths that contain condition branches disabled with null.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated the ChangesExport flattening robustness
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes
lookupNodeModuleSubpathcrashing when a packageexportsmap containsnulltargets.nullis a valid package exports target for disabling a condition or subpath. Previously_flattenExportsrecursively processed non-string values, sonulltargets eventually reachedObject.entries(null)and threw:This change treats null export targets as omitted while flattening exports.
Summary by CodeRabbit