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

VSCode formatting doesn't work right after running npm astro-create@latest #946

Open
1 task
mihailthebuilder opened this issue Aug 26, 2024 · 5 comments
Open
1 task
Labels
- P4: important Violate documented behavior or significantly improves performance (priority)

Comments

@mihailthebuilder
Copy link

mihailthebuilder commented Aug 26, 2024

Astro Info

Astro                    v4.14.5
Node                     v20.9.0
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When I create a new Astro project with npm create-astro@latest, formatting in VSCode doesn't work. After I downgrade to an earlier version (4.11.3), it starts working again. I then upgrade to the latest version, and it works.

What's the expected result?

VSCode formatting works.

Link to Minimal Reproducible Example

https://github.com/mihailthebuilder/astro-format-bug

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Aug 26, 2024
@mihailthebuilder mihailthebuilder changed the title VSCode formatting doesn't work in latest version VSCode formatting doesn't work right after running npm astro-create@latest Aug 26, 2024
@withastro withastro deleted a comment Aug 26, 2024
@bluwy
Copy link
Member

bluwy commented Aug 26, 2024

Do you mean formatting of Astro files, or other files? Seems like this is more specific to vscode or the astro extension.

@mihailthebuilder
Copy link
Author

@bluwy formatting of Astro files. Let me know if I should raise this issue in another repo.

@kingman1016
Copy link

#627 (comment)

@kabirsync
Copy link

adding prettier as a dev dependency seemed to fix this for me

"devDependencies": { "prettier": "^3.0.0" }

@Princesseuh Princesseuh transferred this issue from withastro/astro Aug 29, 2024
@Princesseuh
Copy link
Member

This happens because of yaml-language-server, used now with content intellisense, having a dependency on Prettier 2, which cause formatting to fail.

I'm not sure what we'll be able to do for this, might need to fork upstream 😔

@Princesseuh Princesseuh added - P4: important Violate documented behavior or significantly improves performance (priority) and removed needs triage Issue needs to be triaged labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

No branches or pull requests

6 participants
@Princesseuh @mihailthebuilder @kingman1016 @bluwy @kabirsync and others