Plugin incompatibility with vlucas/phpdotenv v3.3.3
Closed this issue · 3 comments
I've added vlucas/phpdotenv v3.3.3 to my composer.json, but then it shows a fatal error:
Uncaught TypeError: Argument 1 passed to Dotenv\Dotenv::__construct() must be an instance of Dotenv\Loader, string given, called in ...\site\vendor\hiqdev\composer-config-plugin\src\readers\EnvReader.php on line 28 and defined in ...\site\vendor\vlucas\phpdotenv\src\Dotenv.php:31
In their README, they have a section called Upgrading from v2 that says :
Consequently, you will need to replace any occurrences of
new Dotenv(...)
withDotenv::create(...)
, since our new native constructor takes a Loader instance now, so that it can be truly customized if required.
I downgraded to v2.6.1 by adding this: composer require vlucas/phpdotenv:^2.0
and now it's working.
This should be specified in the docs maybe?
Strange, I did fixed the plugin for phpdotenv 3+.
I'll check it once more.
Which version exactly is installed in your case?
I've released the latest changes.
Should be ok now.