Roots Discourse

Trouble deploying an old site: Dotenv\\Dotenv::create()

Hi, It’s been a while since I’ve worked with this site, and I had to spend a bit of time making everything compatible with composer v2. I had this error locally:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Dotenv\\Dotenv::create() must be an instance of Dotenv\\Repository\\RepositoryInterface, string given, called in /vendor/ffraenz/private-composer-installer/src/PrivateComposerInstaller/Plugin.php

And i fixed it by deleting my vendor folder and re-running composer update.

The trouble is that the same error is now occuring when I’m deploying. It seems like the vendor folder is being recreated for each release so I’m not sure why the error display.

I’ll probably rebuild the whole bedrock and trellis installation tomorrow but perhaps someone knows of an easier fix?


Have you tried putting an empty array to the project_copy_folders var in trellis?

Put this in trellis/group_vars/production/main.yml:

project_copy_folders: []

That way, the vendor folder will be created again on every deploy ;D


Genius! Thank you. Works perfectly.

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.