unplugin / unplugin-auto-import

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

`dirs` settings cannot import automatically #238

Closed hooray closed 2 years ago

hooray commented 2 years ago

Describe the bug

In v0.9.2 it works fine, but when I upgrade to v0.10.0, it doesn't work. You can use vitesse to test, just upgrade unplugin-auto-import to v0.10.0 and run it, you will see:

image

Reproduction

/

System Info

/

Used Package Manager

pnpm

Validations

antfu commented 2 years ago

Seems to work fine for me https://github.com/antfu/vitesse/commit/0d5a777f14094bec73e58a3965e8352cffe1b8f6

Please provide a minimal reproduction

Liwoj commented 2 years ago

@antfu Used current version of vitesse (degit + install + run dev) and got same error. auto-imports.d.ts got overwritten and is missing const isDark: typeof import('./composables/dark')['isDark']

Maybe problem is I'm running it on Windows (10) ?

blooddrunk commented 2 years ago

@antfu This can be confirmed on Windows machine(Windows 11 on my use case), reverting to 0.9.5 solves the error. Although it works fine under Linux environment. Seems like unimport fails to resolve the exports inside dirs on Windows environment.

Liwoj commented 2 years ago

Fixed in v0.10.1 Thanks!