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

The import .vue in the .vue file is located as 3 modules, same file but in different scopes #3005

Open
4 tasks done
masquevil opened this issue Jun 14, 2021 · 3 comments
Open
4 tasks done
Labels

Comments

@masquevil
Copy link

masquevil commented Jun 14, 2021

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS
  • Vetur version: 0.33.1
  • VS Code version: 1.56.0
  • Plugins:
    • Vetur 0.34.1
    • Preview VueDX 0.3.1 / Insiders v2021.6.14018628
    • VueDX 0.7.6 / Insiders v2021.6.1133230

Problem

2 bugs:

Bug 1

The import .vue file in the .vue file can be located, but 3 modules will be found, which are the same file but in different scopes:

Found 2 modules when click component name:
Found 2 modules when click name
Found 2 modules when click component file path:
Found 2 modules when click path

Click the first one to enter, all the contents in the <script> tag will be selected:
selected area 1

Click the second one to enter, it will select the defineComponent:
selected area 2

Click the third one to enter, it will select from the <script> tag to the end of the file:
selected area 2

Bug 2

import Comp from './xxx/yyy'

If you do not write .vue or index.vue, the corresponding file cannot be recognized.

Reproducible Case

https://github.com/masquevil/stock

@masquevil masquevil changed the title The import .vue in the .vue file is located as two modules, same file but in different scopes The import .vue in the .vue file is located as 3 modules, same file but in different scopes Jun 14, 2021
@yoyo930021
Copy link
Member

yoyo930021 commented Jun 21, 2021

VueDX will provide the same thing as Vetur.
So you will get two data. You can select enabled only one vue extension.

@masquevil
Copy link
Author

@yoyo930021 Thank you! I tried VueDX and Vetur separately, VueDX worked well, but Vetur still got 2 modules.

@triforcely
Copy link
Contributor

@masquevil I tested your case and when I have only Vetur installed, I get one module. When I added VueDX (so VueDX and Vetur are both enabled) I get two modules. You can use Vetur OR VueDX, with both of them enabled you will have issues like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants