0

I'm currently working on a project based on Sage 9 using php 7.4. When I run npm, it builds fine and runs perfectly except on the site it gives me

Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined function array_except() in /Users/admin/sites/myproject/web/app/uploads/cache/85f0de50487ef01844c6bb7aed13133926433f24.php:3 Stack trace: #0 
/Users/admin/sites/myproject/web/app/themes/myproject/vendor/illuminate/view/Engines/PhpEngine.php(43): include() #1 /Users/admin/sites/myproject/web/app/themes/myproject/vendor/illuminate/view/Engines/CompilerEngine.php(59): Illuminate\View\Engines\PhpEngine->evaluatePath('/Users/admin/si...', Array) #2 /Users/admin/sites/myproject/web/app/themes/myproject/vendor/illuminate/view/View.php(142): Illuminate\View\Engines\CompilerEngine->get('/Users/admin/si...', Array) #3 /Users/admin/sites/myproject/web/app/themes/myproject/vendor/illuminate/view/View.php(125): Illuminate\View\View->getContents() #4 /Users/admin/sites/myproject/web/app/themes/myproject/vendor/illuminate/view/View.php(90): Illuminate\View\View->renderContents() #5 /Users/admin/sites/myproject/web/app/themes/myproject/vendor/roots/sage-lib/Template/Blade.php(58): Il in /Users/admin/sites/myproject/web/app/uploads/cache/85f0de50487ef01844c6bb7aed13133926433f24.php on line 3`

Here is my composer.json

"require": {
    "php": "^7.4",
    "composer/installers": "~1.9",
    "illuminate/support": "5.6.*",
    "roots/sage-lib": "~9.0.9",
    "soberwp/controller": "~2.1.0",
    "roots/sage-installer": "dev-webpack5#f4a07cb"
  },

I have tried almost all the solutions that are laid out by deleting cache, updated composer, and relinked my php with valet with the right php version which is 7.4 but the error is still there. Has anyone had the similar issues?

Samuel Lelièvre
  • 3,212
  • 1
  • 14
  • 27
Justina
  • 1
  • 1
  • Since Laravel 6, helpers have been moved to a separate package and `array_except` became `Arr::except`, it looks like you have cached views (`../cache/85f0de50487ef01844c6bb7aed13133926433f24.php:3`) still using an older assumption that `array_except` exits. You mention running `npm` but that's for JavaScript, `composer` is the package manager for PHP. Have you definitely run `composer install` since switching to PHP 7.4? – Elven Spellmaker Jul 12 '22 at 10:56
  • Yes I have run composer install, update on both root and the project folder but it seems to be having the error still.. – Justina Jul 12 '22 at 11:13

0 Answers0