How I Fixed: Invalid configuration for path base_url: can be: string

Hands up if seemingly half the time you spend at the computer, you’re fighting weird errors, instead of writing code.

Yeah, me too.

Whilst updating the front end of CodeReviewVideos, a Symfony 4 website, I encountered the following issue:

Strangely, the base_url parameter is a string, afaik:

And following that back to the .env  file:

So… what gives?

Well, I found by using a raw string, e.g.:

That yeah, things worked as expected.

And I found that by checking the value of the environment variable inside the running Docker container, that also, yeah, I could see that it was seemingly set:

My Solution

My solution was to force the use of the string  environment variable processor:

And all is right once again in the world.

I wish I understood why that was happening, but I haven’t currently got the time to investigate that further. If you know the root cause, please do share. I’m very curious.

Shares

Published by

Code Review

Code Review

CodeReviewVideos is a video training site helping software developers learn Symfony faster and easier.

One thought on “How I Fixed: Invalid configuration for path base_url: can be: string”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.