How do I debug with Xdebug in Visual Studio Code? When I try to debug Drupal 8 (8.6.11) using Xdebug in VS Code (I'm on Win 10 but I doubt it is relevant in this case) I get the following error:


  Exception has occurred. Dotenv\Exception\InvalidPathException: Unable
  to read the environment file at /app/.env.


The problem is either with VS Code or with Drupal as someone has reported exact same behaviour on High Sierra and they were using Drupal 8.6.10:
https://github.com/lando/lando/issues/1501

I did not find anything in drupal docs about the neccessity of creating a .env file to use Xdebug, so I suspect a bug eihter in Drupal 8 or VS Code.

Has someone encountered similar behaviour?
Should I file a bug report on Drupal site?
InvalidPathException is an exception related to the vlucas/phpdotenv composer package so this issue isn't related to the Lando &amp; VS Code codebases; it's an issue with your Drupal code base. 

You can confirm phpdotenv is a Drupal dependency by looking at your composer.json file and looking at the require section.

The issue is the package dependency isn't finding the /app/.env file in your Lando environment. Confirm that the .env exists in your Lando project root (the same dir as your .lando.yml file).