Hello, i use DDEV for local development, but i have a problem with Twig Debugging. I create my services.yml File and enable Twig debugging, Live Reload and disable the Cache. But i cant see the Comments in my Code Inspector. This only happens, when i use DDEV as my Development Environment. Maybe one of you have experience with DDEV and can help me. 

Comments

danrod’s picture

In your file "settings.ddev.php", add this line at the end of the file:

$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/default/services.yml';

Assuming the file 'services.yml' is located at '/sites/default'

fluidstack’s picture

I think you mean 

$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';

You shouldnt be touching services.yml for development

mariohernandez’s picture

Adding the snippet to setting.ddev.php did it for me.

rfay’s picture

settings.ddev.php is replaced on every start by ddev, so editing it isn't a good idea.

Instead, make your changes in youf settings.php .

mariohernandez’s picture

Thanks.  Since I wrote this comment I have learned sttings.ddev.php shoul dnot be edited.  I typicaly create a settings.php to do any edits I need.  I appreciate the feedback.

Greenman77’s picture

Excellent advise frustrating just simply adding to services.yml

Thankyou settings.php works best to make sure it get's picked up.

ux-guy’s picture

So helpful, thank you for the update!

It's so frustrating when you're new to Drupal and working through D9 tutorials (that feature Twig debugging) and they don't address this.

rfay’s picture

I did a PR to mention this in the DDEV docs, although it's not a DDEV thing, but lots of people discover the problem doing local development. https://github.com/drud/ddev/pull/4158