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

**URL:** https://discourse.roots.io/t/trouble-deploying-an-old-site-dotenv-dotenv-create/21561
**Category:** trellis
**Tags:** composer
**Created:** 2021-10-13T17:16:52Z
**Posts:** 3

## Post 1 by @stuartcusackie — 2021-10-13T17:16:52Z

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?

Thanks!

---

## Post 2 by @carlosfaria — 2021-10-13T19:57:18Z

Have you tried putting an empty array to the **project\_copy\_folders** var in trellis?

> <https://github.com/roots/trellis/blob/f89ae25b32d037bc14168da2ec47b7f874f0f018/roles/deploy/defaults/main.yml#L14>

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

---

## Post 3 by @stuartcusackie — 2021-10-14T10:09:10Z

Genius! Thank you. Works perfectly.

---

## Post 4 by @system — 2021-11-24T17:17:32Z

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