You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my-package/Comp.vue imports ./Config.ts. And I create a working package with vite and import my-package.
// working-package/main.ts
import Config from 'my-package/Config'
import Comp from 'my-package/Comp.vue'
The references to my-package/Config.ts in 'my-package/Comp.vue' and working-package/main.ts are different.
The one in working-package/main.ts is referenced to working-package/node_modules/.vite/...
The one in my-package/Comp.vue is referenced to another place, I think it is the path in node_modules/my-package.
So It could cause many issues such as config singleton and class instance of error.
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.
Describe the bug
node_modules/.vite
directory make references to one file different. The references to one file should be processed as singleton. See the answer of https://stackoverflow.com/questions/64477263/use-module-as-singletonIf I publish a package with the structure:
my-package/Comp.vue
imports./Config.ts
. And I create a working package with vite and import my-package.The references to
my-package/Config.ts
in 'my-package/Comp.vue' andworking-package/main.ts
are different.The one in
working-package/main.ts
is referenced toworking-package/node_modules/.vite/...
The one in
my-package/Comp.vue
is referenced to another place, I think it is the path innode_modules/my-package
.So It could cause many issues such as config singleton and class instance of error.
Reproduction
In the previous section
System Info
Used Package Manager
pnpm
Logs
NONE
Validations
The text was updated successfully, but these errors were encountered: