Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node_modules/.vite cause resource resolution issue. #9657

Closed
6 of 7 tasks
ruojianll opened this issue Aug 13, 2022 · 1 comment
Closed
6 of 7 tasks

node_modules/.vite cause resource resolution issue. #9657

ruojianll opened this issue Aug 13, 2022 · 1 comment

Comments

@ruojianll
Copy link

ruojianll commented Aug 13, 2022

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-singleton

If I publish a package with the structure:

my-package
  --Comp.vue
  --Config.ts

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.

Reproduction

In the previous section

System Info

NONE

Used Package Manager

pnpm

Logs

NONE

Validations

@bluwy
Copy link
Member

bluwy commented Sep 6, 2022

Duplicate of #3910

@bluwy bluwy marked this as a duplicate of #3910 Sep 6, 2022
@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants