title: Invalid characters passed for attempted conversion, these have been ignored - Pushing Laravel project to heroku
body: <p>I am trying to take a laravel project from a server and move it to heroku following all the provided steps, when pushing the repo to heroku, I encounter the following error :</p>
  <pre><code> Compiling common classes
  remote:        
  remote:
  remote:          [ErrorException]
  remote:          Invalid characters passed for attempted conversion, these have been ignored
  </code></pre>
  <p>I have been looking at a guthub issue that states this error - <a href="https://github.com/dompdf/dompdf/issues/2003" rel="nofollow noreferrer">[PHP 7.4 RC3] Invalid characters passed for attempted conversion, these have been ignored #2003</a> - Which is one of the few answers I can find.
  However the file this issue is referencing does not exist in my project (vendor/dompdf/dompdf/lib/Cpdf.php).</p>
  <p>One of the answers suggested turning off error reporting by adding <code>error_reporting(E_ALL ^ E_DEPRECATED);</code> to the file that throws the error. Any idea of where to put that line?</p>
  <p>I can't see what file the error is being thrown on. See message :</p>
  <pre><code>      Script php artisan optimize handling the post-install-cmd event returned with error code 1
  remote:  !     WARNING: A post-install-cmd script terminated with an error
  remote:
  remote:  !     ERROR: Dependency installation failed!
  </code></pre>
  <p>I may be doing something obvoiusly wrong. Followed these steps for the migration : <a href="https://medium.com/laravel-power-devs/deploy-laravel-projects-on-heroku-922776c68243" rel="nofollow noreferrer">Deploy Laravel Projects On Heroku
  </a></p>
  <p>EDIT: Also tried <code>composer update</code> as suggested in the answer to this question <a href="https://stackoverflow.com/questions/59772891/printing-preview-doesnt-working-laravel-dompdf">printing-preview-doesnt-working-laravel-dompdf</a></p>
  <p>EDIT 2: Below is the the build log :</p>
  <pre><code>  Package mtdowling/cron-expression is abandoned, you should avoid using it. Use dragonmantank/cron-expression instead.
  remote:        Generating optimized autoload files
  remote:        Carbon 1 is deprecated, see how to migrate to Carbon 2.
  remote:        https://carbon.nesbot.com/docs/#api-carbon-2
  remote:            You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
  remote:        1 package you are using is looking for funding.
  remote:        Use the `composer fund` command to find out more!
  remote:        &gt; Illuminate\Foundation\ComposerScripts::postInstall
  remote:        &gt; php artisan optimize
  remote:        Generating optimized class loader
  remote:        Compiling common classes
  remote:        
  remote:
  remote:          [ErrorException]
  remote:          Invalid characters passed for attempted conversion, these have been ignored
  remote:
  remote:
  remote:        Script php artisan optimize handling the post-install-cmd event returned with error code 1
  remote:  !     WARNING: A post-install-cmd script terminated with an error
  remote:
  remote:  !     ERROR: Dependency installation failed!
  remote:  !
  remote:  !     The 'composer install' process failed with an error. The cause
  remote:  !     may be the download or installation of packages, or a pre- or
  remote:  !     post-install hook (e.g. a 'post-install-cmd' item in 'scripts')
  remote:  !     in your 'composer.json'.
  remote:  !
  remote:  !     Typical error cases are out-of-date or missing parts of code,
  remote:  !     timeouts when making external connections, or memory limits.
  remote:  !
  remote:  !     Check the above error output closely to determine the cause of
  remote:  !     the problem, ensure the code you're pushing is functioning
  remote:  !     properly, and that all local changes are committed correctly.
  remote:  !
  remote:  !     For more information on builds for PHP on Heroku, refer to
  remote:  !     https://devcenter.heroku.com/articles/php-support
  remote:  !
  remote:  !     REMINDER: the following warnings were emitted during the build;
  remote:  !     check the details above, as they may be related to this error:
  remote:  !     - A post-install-cmd script terminated with an error
  </code></pre>
  <p>I've tried updating the <code>mtdowling/cron-expression</code> package - but it keeps reverting to it. Could this, or the Carbon error be causing the &quot;Invalid characters error&quot; ?</p>