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.

Couldn't resolve parser "php" in local installation

See original GitHub issue

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

  1. npm install --save-dev blade-formatter
  2. node_modules/.bin/blade-formatter resources/**/*.blade.php

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
HDVinniecommented, Nov 3, 2021

I used the docker and don’t have the issue anymore.

0reactions
github-actions[bot]commented, Dec 6, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Couldn't resolve parser "php" · Issue #3081 - GitHub
I installed it globally using composer, if that matters, and ran doom env again, to make sure it had the latest PATH.
Read more >
Why does running prettier check return error "Couldn't resolve ...
I'm currently using prettier 2.3 which does support this parser, so I'm a bit confused as to what I could be doing incorrectly....
Read more >
Document how to resolve nikic/php-parser v3 vs v4 composer ...
I'm trying to use this module on a site that is currently running php 5.6 and drupal 8.5.14 BUT I am running the...
Read more >
Installation/Upgrading Issues - Snipe-IT Documentation
This always means that PHP is either not installed, or is not enabled in your Apache/Nginx/IIS/etc web server. PHP has two different parts...
Read more >
PHP Developers Guide | Parse
Installation. There are various ways to install and use this sdk. We'll elaborate on a couple here. Note that the Parse PHP SDK...
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