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

🐛 BUG: Installing date-fns package breaks import intellisense #967

Closed
thanh-nguyen-95 opened this issue Oct 9, 2024 · 11 comments
Closed
Labels
needs investigation The cause of the issue is unknown and a deeper investigation is needed to fix it needs triage Issue needs to be triaged

Comments

@thanh-nguyen-95
Copy link

thanh-nguyen-95 commented Oct 9, 2024

Describe the Bug

Installing date-fns package makes Astro Language Server stops autocompletion on imports.

Everything works as intended if I'm using VSCode with the latest Astro extension (2.15.2).

Additional info:

  • OS: Linux
  • Kernel version: 6.6.52-1-lts
  • IDE: Neovim 0.10.2 with Mason plugin for LSP
  • Node: 20.17.0
  • Npm: 10.8.2
  • Astro Language Server: 2.15.0

Steps to Reproduce

  1. npm init astro using default options
  2. npm install date-fns
  3. Intellisense stops working

Link to Minimal Reproducible Example

https://github.com/thanh-nguyen-95/astro-ls-error-with-date-fns

@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 9, 2024
@thanh-nguyen-95 thanh-nguyen-95 changed the title 🐛 BUG: Installing date-fns package breaks all language server functionalities 🐛 BUG: Installing date-fns package breaks import intellsense Oct 9, 2024
@thanh-nguyen-95 thanh-nguyen-95 changed the title 🐛 BUG: Installing date-fns package breaks import intellsense 🐛 BUG: Installing date-fns package breaks import intellisense Oct 9, 2024
@Princesseuh Princesseuh added needs repro Issue needs a reproduction and removed needs triage Issue needs to be triaged labels Oct 9, 2024
@Princesseuh
Copy link
Member

Seems to work fine for me:

Screen.Recording.2024-10-09.at.14.35.17.mov

@withastro withastro deleted a comment from github-actions bot Oct 9, 2024
@thanh-nguyen-95
Copy link
Author

thanh-nguyen-95 commented Oct 9, 2024

It DOES work in VSCode with the official extension as I mentioned in the bug report.

I'm using Neovim with a plugin, which uses @astrojs/language-server under the hood. I'm not sure why it stops working after I installed date-fns so I created an issue to see if anyone else has this problem. I assume the VSCode extension also uses @astrojs/language-server so it should work for me, but it's not.

I'm well aware this could be an edge case and could be solved by removing date-fns. Please feel free to close this issue if there's no further update.

@Princesseuh
Copy link
Member

Ah apologies, I missed that part of the original post. Unfortunately, I barely have the time to debug VS Code issues, and so Neovim issues are insanely low priority. I'm sorry.

They do both use the same language server, there's only one LS for Astro

@thanh-nguyen-95
Copy link
Author

It's fine, really. This could very well be a problem with Neovim plugins that I'm using.

Thank you for taking your time and checking out my issue. I'll remove date-fns for now.

You can close this issue now. Thank you

@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2024
@Fakerko
Copy link

Fakerko commented Oct 16, 2024

Guys, I have the same issue. When I add package date-fns, it completely broke .astro files intellisense. When I remove date-fns package, it's working again.

I tried uninstall all other VSCode plugins and tried fresh astro project, but it's caused by the date-fns.

@Fakerko
Copy link

Fakerko commented Oct 16, 2024

Recorded video to demonstrate the issue. When the date-fns is imported, only .astro files are broken.

astro-date-fns.mov

@Fakerko
Copy link

Fakerko commented Oct 18, 2024

@Princesseuh this should be re-open, I am using VSCode not Neovim.

@Princesseuh Princesseuh reopened this Oct 18, 2024
@Princesseuh Princesseuh added needs investigation The cause of the issue is unknown and a deeper investigation is needed to fix it and removed needs repro Issue needs a reproduction labels Oct 18, 2024
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 18, 2024
@Chipsnet
Copy link

I have the same issue.

I noticed that my VSCode astro intellisense was broken and found this Issue, so I uninstalled date-fns and it works fine.

I am using the latest version of Astro extension and VSCode.

OS: Windows 11 23H2 (22631.4112)
IDE: Visual Studio Code 1.94.2
bun: 1.1.32
Astro Extension: 2.15.3
Astro version: 4.15.12

@Fakerko
Copy link

Fakerko commented Oct 29, 2024

After the Astro VSCode plugin last update to v2.15.4 its working as expected for now.

@Princesseuh
Copy link
Member

Awesome. Could anyone else confirm?

@Princesseuh
Copy link
Member

Closing, since it seems like this is fixed. Let me know if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation The cause of the issue is unknown and a deeper investigation is needed to fix it needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants