Incompatible with Prettier 2.0 because of parser option babylon which has been removed (replaced by babel)
See original GitHub issueInfo
- Platform: Win
- Vetur version: 0.24.0
- VS Code version:
Problem
The parser option babylon
has been removed in Prettier 2.0
Error message:
Prettier format failed [Error - 10:52:04 p.m.] Couldn’t resolve parser “babylon”
The fix: https://github.com/vuejs/vetur/blob/master/server/src/modes/script/javascript.ts#L484
Replace babylon
with babel
Reproducible Case
Format a Vue File using prettier 2.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:8
Top Results From Across the Web
babel/parser
The Babel parser (previously Babylon) is a JavaScript parser used in Babel. The latest ECMAScript version enabled by default (ES2020). Comment attachment.
Read more >Prettier 2.0 “2020”
useFlowParser ( --flow-parser in CLI) has been deprecated since v0.0.10 . Option values: parser : babylon (renamed to babel in v1.16.0), ...
Read more >Why does running prettier check return error "Couldn't resolve ...
ts' with a prettier config shown below, I receive the error stating that the babel-ts parser is not resolved. I'm currently using prettier...
Read more >@babel/eslint-parser | Yarn - Package Manager
ESLint parser that allows for linting of experimental syntax transformed by Babel. readme. babel. The compiler for writing next generation JavaScript.
Read more >Open Source Used In Socio 1.0 - Cisco
This document contains licenses and notices for open source software used in ... 1.145 formatjs/icu-messageformat-parser 2.0.14 ... 1.1526 babylon 6.18.0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rnenjoy This is the setting I have in my
.vscode/settings.json
This is specific enough that it doesn’t mess with my other formatting options and fixes the problem with
vue
files.Sorry for the delay: Goto %USERPROFILE%.vscode\extensions\octref.vetur-0.24.0\server\dist\modes\script\javascript.js
Change 398 const parser = scriptDoc.languageId === ‘javascript’ ? ‘babylon’ : ‘typescript’; to const parser = scriptDoc.languageId === ‘javascript’ ? ‘babel’ : ‘typescript’;