Prettier-vscode: ["ERROR" - 1:21:52 PM] Couldn't resolve parser "babylon"

Created on 6 Apr 2020  路  3Comments  路  Source: prettier/prettier-vscode

Summary

Prettier config is not applied. The output says
["ERROR" - 1:21:52 PM] Couldn't resolve parser "babylon"

I removed and reinstalled the prettier extension, but it does not change the issue.

### Github Repository to Reproduce Issue
-

Steps To Reproduce:

Install Prettier in VScode. Let it run on a file.

Expected result

Format the file

Actual result

Error output:
["ERROR" - 1:21:52 PM] Couldn't resolve parser "babylon"

Additional information

_Feel free to attach a screenshot_.

VS Code Version:
1.43.2

Prettier Extension Version:
4.0.0

OS and version:
Mac Os Cataline 10.15.2

Prettier Log Output

["INFO" - 1:21:52 PM] Formatting **/**/**/PropertyList.js
["INFO" - 1:21:52 PM] Using ignore file (if present) at **/**/**/.prettierignore
["INFO" - 1:21:52 PM] Using bundled version of prettier.
["INFO" - 1:21:52 PM] File Info:
{
  "ignored": false,
  "inferredParser": "babel"
}
["INFO" - 1:21:52 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 1:21:52 PM] Prettier Options:
{
  "filepath": "/**/**/**/PropertyList.js",
  "parser": "babylon",
  "useTabs": false,
  "printWidth": 80,
  "tabWidth": 2,
  "singleQuote": true,
  "jsxSingleQuote": true,
  "trailingComma": "es5",
  "jsxBracketSameLine": false,
  "noSemi": true,
  "rcVerbose": true
}
["ERROR" - 1:21:52 PM] Error formatting document.
["ERROR" - 1:21:52 PM] Couldn't resolve parser "babylon"
Error: Couldn't resolve parser "babylon"
    at resolveParser ...
locked

Most helpful comment

The old parser names were removed in prettier 2.0. Rename babylon to babel. See: https://prettier.io/blog/2020/03/21/2.0.0.html#remove-deprecated-options-and-option-values-6993httpsgithubcomprettierprettierpull6993-7511httpsgithubcomprettierprettierpull7511-7533httpsgithubcomprettierprettierpull7533-7535httpsgithubcomprettierprettierpull7535-7536httpsgithubcomprettierprettierpull7536-by-fiskerhttpsgithubcomfisker

To avoid this type of issue, we recommend installing prettier in your project and using project-specific configuration. This way you control the versions of what is being used.

All 3 comments

The old parser names were removed in prettier 2.0. Rename babylon to babel. See: https://prettier.io/blog/2020/03/21/2.0.0.html#remove-deprecated-options-and-option-values-6993httpsgithubcomprettierprettierpull6993-7511httpsgithubcomprettierprettierpull7511-7533httpsgithubcomprettierprettierpull7533-7535httpsgithubcomprettierprettierpull7535-7536httpsgithubcomprettierprettierpull7536-by-fiskerhttpsgithubcomfisker

To avoid this type of issue, we recommend installing prettier in your project and using project-specific configuration. This way you control the versions of what is being used.

Thanks :)

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