unplugin / unplugin-auto-import

Auto import APIs on-demand for Vite, Webpack and Rollup
MIT License
3.21k stars 195 forks source link

Cannot auto import types #474

Open thehrz opened 7 months ago

thehrz commented 7 months ago

Describe the bug

Cannot auto import types added to the dirs config.

This seems to be because includeTypes is set to false when calling scanExports.

https://github.com/unplugin/unplugin-auto-import/blob/128d050107af1b57ffe2fe2b32018e4110042bde/src/core/ctx.ts#L33

Reproduction

https://stackblitz.com/edit/typeserror?file=src%2Fmain.ts

System Info

System:
  OS: Linux 6.7 Arch Linux
  CPU: (16) x64 13th Gen Intel(R) Core(TM) i5-13400F
  Memory: 49.13 GB / 62.64 GB
  Container: Yes
  Shell: 5.9 - /usr/bin/zsh
Binaries:
  Node: 18.18.2 - /usr/bin/node
  npm: 10.4.0 - /usr/bin/npm
Browsers:
  Chromium: 121.0.6167.160

Used Package Manager

npm

Validations

stackblitz[bot] commented 7 months ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

tryforceful commented 6 months ago

See also #61

s3xysteak commented 3 weeks ago

Is anyone tracking on that?