I think in addition to updating vlucas/phpdotenv, you need to change this line in config/application.php
$dotenv = Dotenv\Dotenv::createImmutable($root_dir);
To this
$dotenv = Dotenv\Dotenv::createUnsafeImmutable($root_dir);
I haven’t tested my local site yet, so this my guess.