Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't resolve parser "postcss" #88

Open
jose4125 opened this issue Aug 23, 2020 · 2 comments
Open

Couldn't resolve parser "postcss" #88

jose4125 opened this issue Aug 23, 2020 · 2 comments

Comments

@jose4125
Copy link

when I ran :Prettier to format my scss file. I got this error, Could you help me fixing it? thanks

[coc.nvim]: UnhandledRejection: Couldn't resolve parser "postcss"
Error: Couldn't resolve parser "postcss"
    at resolveParser (/Users/bbb/Sites/rot-project/ui-rot/node_modules/prettier/index.js:11343:15)
    at normalize$1 (/Users/bbb/Sites/rot-project/ui-rot/node_modules/prettier/index.js:11438:18)
    at formatWithCursor (/Users/bbb/Sites/rot-project/ui-rot/node_modules/prettier/index.js:15034:12)
    at /Users/bbb/Sites/rot-project/ui-rot/node_modules/prettier/index.js:51620:12
    at Object.format (/Users/bbb/Sites/rot-project/ui-rot/node_modules/prettier/index.js:51640:12)
    at /Users/bbb/.config/coc/extensions/node_modules/coc-prettier/node_modules/prettier-stylelint/src/index.js:129:30
@nulty
Copy link

nulty commented Mar 23, 2021

I just hit this issue myself.

The issue is that coc-prettier is using prettier-stylelint to interface with prettier for formatting scss. That project hasn't been updated in 4 years. Recommendation is to switch to stylelint-prettier which is under development and maintained by the prettier organisation.

The parser in prettier-stylelint is hard coded to use postcss but prettier has changed it's API is require css as the parser name.

@nulty
Copy link

nulty commented Mar 24, 2021

I think using the CocConfig flag "prettier.onlyUseLocalVersion": true is a work around but you'll need it installed locally of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants