-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
🐛 BUG: Astro import duplication bug #928
Comments
I cannot seem to be able to reproduce this, and I'm not sure why that version would introduce that issue, but I'll take a look! |
I have disabled all extensions, but the problem persists. You can try to reproduce the issue using the repository I uploaded. Code_nxBOOpSuR3.mp4 |
Even with your repo, I cannot reproduce the issue. There's probably something else at play here, maybe Windows etc. |
Well, if I can help or try anything else, just let me know. |
Can confirm this is also happening to me on Windows on all Astro repositories when I have organizeImports turned on. Reverting back to 2.12.8 likewise fixed the issue |
So far I have absolutely no idea what could cause this, the only difference between those two versions is the SCSS and LESS support, which should be totally unrelated to the frontmatter 🤔 I can confirm that I can reproduce on Windows, though. |
@Zyruks @MattheousDT Does this still happen to you after the update? |
Code_aXFZSXiVXn.mp4 |
Yep, just figured out what's the reason. Working on a fix now! It only affects CRLF files, so at least it's possible to use LF as a workaround until a fix is released. Apologies for the inconvenience. |
It should be fixed in the last version, apologies for the delay, issue ended up being a bit complicated. |
Describe the Bug
When enabling
organizeImports
in VSCode settings, saving a file in an Astro project duplicates the import statements, especially when using import aliases defined intsconfig.json
. This issue occurs in Astro v2.13.1 and v2.13.0 but not in v2.12.8.Environment:
Additional Context:
Disabling
organizeImports
resolves the issue temporarily. Reverting to version 2.12.8 resolves the issue as well..vscode/settings.json
Bug in Action:
Code_Vl3LKhcC7n.mp4
If you need more information or further details, please let me know.
Steps to Reproduce
organizeImports
in the VSCode settings.tsconfig.json
(e.g.,@components
,@layouts
).Expected Behavior
The import statements should not be duplicated upon saving.
Actual Behavior
Import statements are duplicated upon saving the file, particularly when using import aliases from
tsconfig.json
.Link to Minimal Reproducible Example
https://github.com/Zyruks/astro-import-duplication-bug
The text was updated successfully, but these errors were encountered: