blade-formatter
blade-formatter copied to clipboard
Couldn't resolve parser "php" in local installation
Context (Environment)
We're trying to use blade-formatter in a Laravel 8 project on the latest MacOS but it can't resolve the PHP parser. It does work when installing globally but we'd rather have it locally if possible.
Thanks for any help in advance!
Current Behavior
Every call results in the following error for every blade template checked
{
path: 'resources/views/xxx/show.blade.php',
message: `Couldn't resolve parser "php"`,
error: ConfigError$1: Couldn't resolve parser "php"
at resolveParser$1 (/xxx/node_modules/blade-formatter/node_modules/prettier/index.js:12487:13)
at normalize$1 (/xxx/node_modules/blade-formatter/node_modules/prettier/index.js:12582:18)
at formatWithCursor$1 (xxx/node_modules/blade-formatter/node_modules/prettier/index.js:14265:46)
at /xxx/node_modules/blade-formatter/node_modules/prettier/index.js:59304:12
at Object.format (/xxx/node_modules/blade-formatter/node_modules/prettier/index.js:59324:12)
at formatStringAsPhp (/xxx/node_modules/blade-formatter/src/util.js:42:19)
at /xxx/node_modules/blade-formatter/src/util.js:133:16
at String.replace (<anonymous>)
at Function.replace (/xxx/node_modules/lodash/lodash.js:14608:48)
at /xxx/node_modules/blade-formatter/src/util.js:132:9
}
Expected Behavior
No error message :-)
Steps to Reproduce
-
npm install --save-dev blade-formatter
-
node_modules/.bin/blade-formatter resources/**/*.blade.php
Any fix to this?
@shufo
Tried installation on mac machine on CI and exec formatter but it seems format successfully. https://github.com/shufo/blade-formatter/runs/4090339705?check_suite_focus=true
@pboese Can you provide more specific information like package list in package.json, mac os version or node version, etc?
I used the docker and don't have the issue anymore.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days