Open lucastraba opened 1 year ago
An update to this:
This is happening because of pnpm
's hoisting. It seems that the unimport
build happens separately and generates one hash and then unplugin-auto-import
builds based on a different build or a different environment, and produces the wrong import.
Things I tried:
unimport
: I couldn't get pnpm
to not hoist it, no matter what I triedI tried to see if I could come up with a fix and make a PR, but unfortunately I don't have the time to look into it with the amount of attention it would need. For anyone trying to fix it, it's specifically that: the the build of unimport
combined with the build of unplugin-auto-import
happening in a disconnected way due to pnpm
's hoisting.
As it is, I have no choice but to remove the package from our project, but I'll keep an eye on this issue, because I'd really, really like to use this.
Bump :(
same here!
Any news about this? I'd really really like to use this plugin!
Bump?
Describe the bug
I've been trying to use this plugin in a Vite package of my pnpm monorepo, but I can't, because in the Vite plugin, the import of the types file is:
import 'unimport/dist/types-XXXXXX'
And the actual file is:types-YYYYYY.d.ts
This seems to only happen with a
pnpm
monorepo setup, not when installing withnpm
(path and name match there).Reproduction steps:
test.js
types
importActual: Import path hash has the same hash as the file
Expected: Import path matches file name
Reproduction
https://codesandbox.io/p/sandbox/zealous-sky-hq87mv?file=%2Ftest.js%3A1%2C46
System Info
Used Package Manager
pnpm
Validations