You can change your composer.json's "scripts" to the following to make composer clear the compiled files before updating:
"scripts": {
"pre-install-cmd": [
"php artisan clear-compiled"
],
"post-install-cmd": [
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
There are quite a bit of side-effects caused by the compiled.php file, and all of them can't be avoided unfortunately.
Ok, that worked. Thank you. Do you know why this is happening? I think some versions ago, I did not get this error.
As a side note to others, whom like myself, find this page when searching "artisan clear-compiled returned with an error"; I fixed this error by removing a helper file I was auto-loading that no-longer existed.
After deleting said helper file my entire Laravel app stopped working and would only render a white screen to the browser. That's when I realized I still needed to remove the helper from my composer.json file.
RApuzzo, thats what im getting now, any reason why the helper file is causing this?
Never mind figured it out, the helper file name case was not the same as what I typed in the json file... duh
I had the same problem, does anybody know why it happens ?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community