-
-
Notifications
You must be signed in to change notification settings - Fork 210
Open
Description
Describe the bug
Bug: unplugin-auto-import
fails to resolve @vueuse/core
preset in pnpm monorepos when running vitest from root
In pnpm monorepos, unplugin-auto-import
resolves preset modules from the calling context (root) instead of the workspace context where the vite.config.ts
is located. This causes @vueuse/core
preset resolution to fail when running npx vitest
from the monorepo root.
The Issue:
- ✅ Works:
vue
,vue-router
,pinia
presets (different resolution logic) - ❌ Fails:
@vueuse/core
preset (tries to resolve from root instead of workspace)
Error:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
Error: [auto-import] failed to load @vueuse/core, have you installed it?
Minimal reproduction: https://github.com/lucastraba/unplugin-auto-import-repro
Run pnpm reproduce-bug
to see the issue - workspace tests pass but root tests fail due to incorrect module resolution context.
Reproduction
https://github.com/lucastraba/unplugin-auto-import-repro
System Info
System:
OS: macOS 15.5
CPU: (10) arm64 Apple M1 Max
Memory: 93.17 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
pnpm: 10.13.1 - ~/Library/pnpm/pnpm
bun: 1.2.17 - ~/.bun/bin/bun
Browsers:
Chrome: 138.0.7204.158
Edge: 135.0.3179.85
Safari: 18.5
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
Metadata
Metadata
Assignees
Labels
No labels