Hi,
We’re currently building a new theme with Sage 10, but for some reason, we’re unable to use wp cli with it.
We’re working within a fresh bedrock install and I’ve tried the tips added to this thread (PHP Fatal error - Dotenv not found - cannot use WP CLI because of it. Any ideas?) but with no luck, unfortunately.
The strange thing is that when we delete the theme folder, wp cli works again, but there don’t seem to be any dotenv dependencies within Sage?
Bedrock composer file:
{
"name": "roots/bedrock",
"type": "project",
"license": "MIT",
"description": "WordPress boilerplate with Composer, easier configuration, and an improved folder structure",
"homepage": "https://roots.io/bedrock/",
"authors": [
{
"name": "Scott Walkinshaw",
"email": "scott.walkinshaw@gmail.com",
"homepage": "https://github.com/swalkinshaw"
},
{
"name": "Ben Word",
"email": "ben@benword.com",
"homepage": "https://github.com/retlehs"
}
],
"keywords": [
"bedrock", "composer", "roots", "wordpress", "wp", "wp-config"
],
"support": {
"issues": "https://github.com/roots/bedrock/issues",
"forum": "https://discourse.roots.io/category/bedrock"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org",
"only": ["wpackagist-plugin/*", "wpackagist-theme/*"]
},
{
"type": "vcs",
"url": "git@github.com:Imaginaire/im-cpt.git"
},
{
"type": "vcs",
"url": "git@github.com:Imaginaire/im-clean.git"
},
{
"type": "vcs",
"url": "https://github.com/wp-media/wp-rocket.git"
},
{
"type": "vcs",
"url": "git@github.com:Imaginaire/im-logo.git"
},
{
"type": "vcs",
"url": "git@github.com:Imaginaire/im-blocks.git"
},
{
"type": "vcs",
"url": "git@github.com:theimaginaire/acf-private.git"
},
{
"type": "vcs",
"url": "git@github.com:Imaginaire/gravity-forms.git"
}
],
"require": {
"php": ">=7.4",
"composer/installers": "^2.1",
"vlucas/phpdotenv": "^5.4",
"oscarotero/env": "^2.1",
"roots/bedrock-autoloader": "^1.0",
"roots/bedrock-disallow-indexing": "^2.0",
"roots/wordpress": "5.9.3",
"roots/wp-config": "1.0.0",
"roots/wp-password-bcrypt": "1.1.0",
"roots/acorn": "^2.0.1",
"imaginaire/im-clean": "1.0.1",
"wpackagist-plugin/sucuri-scanner": "dev-trunk",
"wpackagist-plugin/seo-by-rank-math": "dev-trunk",
"wpackagist-plugin/wp-mail-smtp": "dev-trunk",
"wpackagist-plugin/redirection": "dev-trunk",
"wpackagist-plugin/custom-post-type-ui": "dev-trunk",
"wpackagist-plugin/custom-permalinks": "dev-trunk",
"wpackagist-plugin/intuitive-custom-post-order": "dev-trunk",
"wpackagist-plugin/page-or-post-clone": "dev-trunk",
"elliotcondon/advanced-custom-fields-pro": "^5.12",
"gravity-forms/gravity-forms": "^2.6"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.6.2",
"roave/security-advisories": "dev-latest"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"allow-plugins": {
"composer/installers": true,
"roots/wordpress-core-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"installer-paths": {
"web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"]
},
"wordpress-install-dir": "web/wp"
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"test": [
"phpcs"
]
}
}
Any help would be massively appreciated!