question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Couldn't resolve parser "babel"

See original GitHub issue

Since Jan 25, this package is breaking on Sublime 3 with following error:

------------------
 JsPrettier ERROR 
------------------

Prettier reported the following error(s):

[warn] Ignored unknown option `--html-whitespace-sensitivity=css`.
[error] Error: Couldn't resolve parser "babel"

Process finished with exit code 1

NPM versions:

  • prettier@1.16.1
  • babel-cli@6.26.0
  • babel@6.23.0

Sublime Packages:

  • Babel@8.6.3
  • JSPrettier@1.23.1

OSX 10.13.6

Any suggestions?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
rmcauleycommented, Jan 28, 2019

Try to remove the prettier package from your package.json file, either by yarn remove or npm uninstall, then install it again, this worked for me

Prettier 1.16 or greater now appears to be a requirement here, so removing it from your package.json and installing the latest version will fix the problem.

The issue appears to be that Prettier <=1.15 uses the plugin “babylon” but 1.16 uses “babel.” There is the parser option available for CLI prettier but the Sublime plugin sets it automatically, overriding anything you set in the Sublime plugin setting. If we could change the plugin name, we could fix the problem ourselves.

As it is I now have to submit a PR to my team to change the package.json just to fix my Sublime Text, which is not ideal.

2reactions
Twizzeldcommented, Jan 27, 2019

I reinstalled the npm package prettier and it started working for me. npm install -g prettier

Hope that helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JsPrettier Sublime Error 'Couldn't Resolve Parser "babel"'
Currently working in a project with create-react-app. JsPrettier version 1.24.0 Sublime version 3.1.1. These are my Babel settings: "debug": ...
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 >
JsPrettier Sublime Error 'Couldn't Resolve Parser "babel"' (2 ...
JsPrettier Sublime Error ' Couldn't Resolve Parser " babel "'Helpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith ...
Read more >
@babel/eslint-parser - npm
If you have an issue, please first check if it can be reproduced with the default parser and with the latest versions of...
Read more >
babel/parser
errorRecovery: By default, Babel always throws an error when it finds some invalid code. When this option is set to true , it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found