fix: types resolution when using typescript moduleResolution bundler
๐ Linked issue
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [x] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality like performance)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
New Typescript bundler resolution algorith picks first matched option, if types are at the end it is likely other option will be matched first and error will be shown Cannot find module 'ofetch' or its corresponding type declarations.ts(2307) pnpm
More context as for why can be found here by core Typescript maintainer here.
TLDR. Put types field first.
๐ Checklist
- [ ] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 69.67%. Comparing base (
27996d3) to head (f087bf8). Report is 17 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #320 +/- ##
===========================================
+ Coverage 56.86% 69.67% +12.80%
===========================================
Files 16 15 -1
Lines 728 610 -118
Branches 113 115 +2
===========================================
+ Hits 414 425 +11
+ Misses 303 175 -128
+ Partials 11 10 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for PR. Testing on https://arethetypeswrong.github.io/
1.3.4:
this PR: