Skip to content

Extension stopped formatting my files / strange behavior since Prettier update  #488

@dummdidumm

Description

@dummdidumm

The bug

Formatting does not work anymore / Output View shows a big error log when formatting.

How to get this working again

  1. If you use the VSCode extension, make sure you have version 101.11.0 or higher installed
  2. Delete your node_modules where your npm/yarn installs live
  3. Update your package.json: If you have svelte-check / prettier-plugin-svelte / svelte-language-server in there, set them to the latest version. If you don't have them in there, you don't need to install them
  4. reinstall (npm i / yarn install)

More indepth

We deployed an update of the VSCode extension which contains the v1.1.1 of prettier-plugin-svelte. It leaves Prettier at 2.0.5 to wait for some more bug fixes, but if you have a different Prettier version in your workspace then that one is used instead.

To get formatting again, you also have to update your prettier-plugin-svelte version in your workspace, which you have installed if you installed svelte-check. Simply update svelte-check for that. If you did not install svelte-check or prettier-plugin-svelte directly, you can skip this.

Reason why you need to do this: Prettier will load prettier-plugin-svelte from both your workspace and our VSCode extension, but for some reason does use the workspace version for parsing and the extension version for formatting, which will break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions