Prettier-vscode: 1.8.0 problem

Created on 31 Jan 2019  路  11Comments  路  Source: prettier/prettier-vscode

Latest version (1.8.0) is not working for me. Previous version (1.7.3) working fine.

$ code --version
1.30.2
61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
x64

$ uname -a
Linux xtc 4.10.0-40-generic #44~16.04.1-Ubuntu SMP Thu Nov 9 15:37:44 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Error message

31/1/2019 17:28:39:
-------------------
Couldn't resolve parser "babel"

.prettierrc

{
    "printWidth": 110,
    "tabWidth": 4,
    "singleQuote": true,
    "trailingComma": "es5",
    "bracketSpacing": false,
    "proseWrap": "always",
    "overrides": [
        {
            "files": "package.json",
            "options": {
                "printWidth": 250
            }
        },
        {
            "files": "*.md",
            "options": {
                "tabWidth": 2
            }
        }
    ]
}

First lines of .eslintrc (not sure if relevant)

root: true
parser: babel-eslint
settings:
    react:
    ...
locked

Most helpful comment

@glebec you can also Install another version...

image

All 11 comments

Same here.
v1.8.0: seems to work in Mac, but not in Linux
v1.7.3: works fine

I had to update prettier to get it working.
Both on the project dependencies and the local global version (npm i -g prettier).

Same issue here. But on Mac.

1.7.3 worked fine, 1.8.0 is broken. Output: Couldn't resolve parser "babel"

Already tried installing prettier & babel globally. And reinstalling prettier, babel, prettier-vscode.

code --version
1.30.2
61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
x64

uname -a
Darwin Kazimir.local 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64

Edit: Not using prettier through a project's dependencies. Just generally for JS/TS files.

Same, had to downgrade on Mac. Don't have prettier in the project, but globally.

Had to downgrade to an earlier version (on MacOS 10.4), using the following steps:

Click to see outdated instructions, prefer using @francocorreasosa's tip below!

  1. Download version 1.7.2 as a VISX file
  2. In VSC, uninstall the Prettier extension
  3. CMD + SHIFT + P and type `VISX`, ENTER to select "鈥nstall from VISX"
  4. Select the downloaded file
  5. Reload VSC when it tells you to
  6. Voil脿, it works again.

Note, you may or may not have to disable extension auto-updates to prevent the regression from coming back. I haven't checked that yet.

@glebec you can also Install another version...

image

HAH. That would have been good to know 5 minutes ago. 馃槅 Thanks!

1.8.0 is broken for me as well on mac. Same error.

getSupportInfo seems to lie :-)

A current workaround could be (I didn't tested it):
a prettier config file with

{ 
"overrides": [
    {
      "files": "*.js",
      "options": {
        "parser": "babylon"
      }
    }
  ]
}

This should force the parser to be "babylon"

Fixed in #706. Released in 1.8.1
Thanks @JHilker !

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings