Repository navigation
fix(types): emit auto-import paths as files, not directories - #4333
Conversation
|
@danielroe is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
ð WalkthroughWalkthroughThe PR fixes node module path resolution in Nitro's ChangesNode module subpath resolution in type declarations
Estimated code review effortðŊ 2 (Simple) | âąïļ ~10 minutes ðĨ 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 |
commit: |
ð Linked issue
originally reported against Nuxt: nuxt/nuxt#35248, but it reproduces in pure Nitro
also related: #1528, #4297
â Type of change
ð Description
writeTypesemitsconst foo: typeof import('<path>').fooper auto-imported bindingfor some packages, the path ends up being the package directory rather than a file; this works fine for TypeScript with
moduleResolution: bundler, but Deno's TS host doesn't apply Node directory resolution to relative specifiers and bailsthis PR treats
./the same as an empty subpath & falls back to resolvedPath, which ends up having its extension strippedboth typescript + deno should resolve this equally well.
note: packages with different
exports.typesvsexports.imports(eg #2384) won't work correctly, either before or after this fix (but the error slightly changes ð)ð Checklist