-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
feat: deps optimizerEsbuild Dependencies OptimizationEsbuild Dependencies Optimizationp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
I have a component (A) with a default export of the component and a named export in the same file. This component also contains an import.meta.glob and imports a directory (B).
Subsequently, Component A is imported into another component, C, which also contains an import.meta.glob of the same directory.
This results in:
Error: Failed to scan for dependencies from entries:
/home/projects/vue3-vite-starter-w2qd5j/index.html
✘ [ERROR] Ambiguous import "something" has multiple matching exports
script:/home/projects/vue3-vite-starter-w2qd5j/src/App.vue?id=0:2:21:
2 │ import HelloWorld, { something } from '@/components/HelloWorld.vue'
╵ ~~~~~~~~~
One matching export is here:
script:/home/projects/vue3-vite-starter-w2qd5j/src/components/HelloWorld.vue?id=0:19:13:
19 │ export const something = 'something'
╵ ~~~~~~~~~
Another matching export is here:
script:/home/projects/vue3-vite-starter-w2qd5j/src/components/HelloWorld.vue?id=1:19:13:
19 │ export const something = 'something'
This issue arises only when the directory imported with import.meta.glob contains multiple files.
Overview:
Reproduction
https://stackblitz.com/edit/vue3-vite-starter-w2qd5j
Steps to reproduce
Run yarn dev --force
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.3 - /usr/local/bin/pnpm
npmPackages:
@vitejs/plugin-vue: ^5.0.4 => 5.0.4
vite: ^5.1.5 => 5.1.6
Used Package Manager
yarn
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
feat: deps optimizerEsbuild Dependencies OptimizationEsbuild Dependencies Optimizationp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)