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
Imports to Components were inserted to random positions. #2501
Comments
Please provide a repro project |
I am also having this issue. Also maybe #2633 is related. When I create a component to use in my view, auto-complete pops up when I begin typing in the component tag in my template and always auto-imports regardless if I have imported it or not. Sometimes somewhere random in my script, thus breaking it. No matter of how many imports there are, auto-complete will offer a choice and it will always be to import the component. Perhaps it's something with my settings? Or VSCode even? I'm not sure and would like to know if anyone has encountered the same. But the workaround I've found is to turn this setting off I have only just found the workaround here #2633 (comment) so not sure how many things it affects, however it does solve the issue. Autocomplete appearing |
@MrSiby I guess you didn't set up path aliases for typescript, as the comment suggested. So typescript, which powers the js/ts language features, is not aware that these import paths are the same. |
@jasonlyu123 I've set up the typescript config and after changing all of the kebab-case references to pascal case the auto complete works better and does not import the component infinitely. However it doesn't auto import at all, but I'm assuming it's to do with some other part of my configs. I'm still learning how to build SPAs with vue 3 and referencing multiple learning sources, all with different experience levels so my set up is a bit messy anyway. Thank you for the link and pointing me in the right direction. It has helped my learning. |
This happens for me as well. The project I'm writing in doesn't use typescript either. A few strange things happen:
|
Vetur: Restart VLS
Info
Problem
When editing the template of a component with help from IntelliSense auto completion and typing the component name as a tag name, even if already declared, a new import is still generated, its contents being inserted to random positions in the
script
part of the Vue code.Reproducible Case
The text was updated successfully, but these errors were encountered: