unimport icon indicating copy to clipboard operation
unimport copied to clipboard

Duplicate import warning when linking to a package

Open cjpearson opened this issue 2 years ago • 1 comments

Environment

Node v18.16.0, Nuxt 3.7.1, Unimport 3.3.0

Reproduction

In v3.3.0 both the .d.ts and .mjs files are being imported from a linked package, causing import warnings.

Describe the bug

I have a nuxt module that registers a directory of composables for auto-import. It works fine when installed to node_modules, but as of [email protected] there is now a warning that occurs whens the module is linked.

Duplicated imports "useLog", the one from "[path to package]/dist/runtime/composables/core/useLog.d.ts" has been ignored

It looks like scanFilesFromDir should be ignoring the .d.ts files, but it doesn't work when the package is linked.

Additional context

No response

Logs

No response

cjpearson avatar Sep 12 '23 09:09 cjpearson

We are also seeing this with various nuxt modules which register composables for auto importing as well as importing and using those composables internally within registered components!

robinscholz avatar Sep 21 '23 06:09 robinscholz