Currently we are working on a project running on sage 10. When deploying to one of our servers, we are getting Undefined variable error messages. We’ve tried to find the issue, if we run composer dump-autoload, the issue seems to be solved. But each time we deploy, the error comes back again. It looks like the variables inside of our composers are not getting created.
We are making use of the
Roots\Acorn\ComposerScripts::postAutoloadDump, and the correct markup for our composer (protected static $views and public function with). Does anyone have experience with this problem and knows how to fix it?
did you add this in Acorn ?
We also recommend adding Acorn’s
postAutoloadDump function to Composer’s
post-autoload-dump event in the
scripts section of
What is your deploy process?
name: Install Composer dependencies
- composer install --no-ansi --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts --classmap-authoritative
name: Build yarn
- yarn build
After that, it makes an rsync call to the server. I’ve already tried changing the composer script to
- composer install --no-dev with no success.
wp acorn optimize as a step in your deployment process