I’m writing a Livewire app on a MacBook, and everything works perfectly. I go to deploy onto a production server today, setup by forge with default settings.
On the server, when trying to access my app or running php artisan view:cache
, I get this error;
InvalidArgumentException
Unable to locate a class or view for component [layouts.base].
at vendor/laravel/framework/src/Illuminate/View/Compilers/ComponentTagCompiler.php:274
270▕ if ($viewFactory->exists($view = $this->guessViewName($component))) {
271▕ return $view;
272▕ }
273▕
➜ 274▕ throw new InvalidArgumentException(
275▕ "Unable to locate a class or view for component [{$component}]."
276▕ );
277▕ }
278▕
The layout/component it claims to not exist, is infact present in the path it claims “doesn’t exist”. No idea what is causing this. There is very little in the way of solutions online about this so I would appreciate some help figuring it out.
I’m using exactly the method Caleb uses for his layouts in Surge, so I have absolutely no idea why this is happening. If your unfamiliar with the above, then please look below.
View\Components\Layouts\App.php
<?php
namespace App\View\Components\Layouts;
use Illuminate\View\Component;
class App extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|string
*/
public function render()
{
return view('layouts.app');
}
}
resources\views\layouts\app.blade.php
<x-layouts.base>
<!-- Content... -->
</x-layouts.base>