Laravel Livewire App not working after clearing cache - caching

My app just displays the html code in the browser. It worked fine. I was actually working on an update when I noticed the view didn't seem to refresh, so I cleared cookies in my browser. That didn't work so I ran php artisan view:clear. It was still not working, so I just wanted to reset and clear all cache and ran php artisan optimize:clear. After attempting to reset and cache everything the view been messed up and all I see is the html in the browser. I have tried what I feel like is every artisan command, php artisan config:clear
php artisan config:clear and cache, php artisan view:clear and cache
php artisan route:clear and cache, php package:discover, livewire:discover, composer dump-autoload, - delete all in bootstrap cache, sudo rm -rf vendor/ , sudo rm composer.lock composer install, npm install, npm run dev, reinstall everything. I even just decided to clone a whole new project from the repo. Composer install, npm install, npm run dev and still the save exact issue. Help is appreciated. The routes still seem to work on the navbar, it is just the views. Thanks!
UPDATE: Another developer cloned the project on their computer and it works fine. Still can't get it to work on mine.

I have also encountered the same issue. It happens because of having an HTML comment at the beginning of the livewire blade component. For example,
<!-- <div> -->
Remove the HTML comment and it will resolve the issue.

Enclose all your livewire components blade code inside a parent div tag. I think it will solbe your issue.

Check this:
enter link description here
I was also having this problem, and realized that the config for manifest_path was pointing to the wrong directory. As you can see, /tmp/storage/bootstrap/cache doesn't exist for a fresh Laravel install on a local machine so it can't ever find it.
The solution is to publish the config with php artisan vendor:publish --tag=livewire:config and then change manifest_path to the appropriate path, mine being \bootstrap\cache\livewire-components.php.
Hope this helps!

Related

Suddenly getting "Target class [Inertia\Ssr\Gateway] does not exist." I don't use Inertia's SSR. How can I get back to a functioning site?

I've got a Laravel Jetstream project using Inertia. I've been running it for a while. Launched on Jetstream v1, later upgraded to v2. Everything has been running great. Today I was messing with some composer and npm stuff and suddenly every page is broken. I just get an error that looks like this:
Illuminate\Contracts\Container\BindingResolutionException
Target class [Inertia\Ssr\Gateway] does not exist.
This happens on every view. I have never used Inertia's SSR, and I don't want to (at least not currently). I tried resetting both my composer json files and my npm json files but I cannot get back to my functioning site. I'm losing my mind. Any ideas of how I can get back to my original functioning site?
Try to remove vendor folder and node_modules.
Then run
composer install
and :
npm install
After that try to run these commands:
php artisan cache:clear
php artisan view:clear
php artisan route:clear
composer dump-autoload

laravel jetstrap problem - the page is shapeless

I created a new project and added a Jetstream. After that i used jetstrap to swap for using bootstrap. But the page is very shapeless as an images:
how to fix this problem, if you help me i will be glad
Try to install bootstrap on your laravel project with the followings:
composer require laravel/ui
php artisan ui bootstrap
npm install && npm run dev
If you don't see any changes, try to clear the browsing data and/or clear the project cache, with:
php artisan cache:clear
and
php artisan view:clear

Laravel project pages not showing

I have cloned a laravel project from github and when I try to use it on my localhost, all I see is the homepage, which is fully functional, but has bits of content and images missing. Then if I try to go to any other route I get an error saying The requested URL was not found on this server.
For reference I am using MAMP as the web server, I have checked the httpd file and everything seems okay, anyone got a clue what's going on?
Use these commands in order :
cp .env.example .env
composer install
php artisan key:generate
php artisan migrate:fresh --seed
npm install
npm run dev
php artisan serve

Downloaded laravel project hangs on preloader when deployed on localhost

I'm trying to deploy a laravel project I have received onto my localhost but it hangs on the loading page and doesn't load the site.
I received the source code of a laravel project that was coded for me.
The deployed website on the shared hosting works properly, and I can also manipulate the files through my ftp access.
However, I'm trying to deploy the project on my localhost (as well as to migrate to a different shared hosting service).
I tried loading the server on wamp, homestead and with artisan serve, but all methods end up the same - the index.php seems to be loading, but is stuck eternally on the preloading .gif file and doesn't present the site.
the browser debugger is throwing a lot of javascript errors (see attached image)
I assume a have a config problem, but I can't locate it and I am unsure how to even locate & debug the issue.
I tried following these configuration steps:
1. changed .htaccess to generic laravel .htaccess (deleted cpanel related lines)
2. changed the .env to fit my wamp db / homestead db
3. composer install
4. composer update
5. php artisan key:generate
6. php artisan cache:clear
7. php artisan migrate
I also installed laravel-debugbar but it hasn't helped me out of the box, and I'm unsure where I need to try to catch the problem.
If anyone can give me pointers on how to understand my problem better, I would be very thankful.
Thanks in advance!
laravel bug
Double check your .env if all details are correct
Set APP_DEBUG=true in your .env file
Double check if your database exist and have data if you are using a database
Check if your host is added to /etc/hosts
Check if your host is added to apache/nginx config correctly
Try running these commands:
$ rm composer.lock package-lock.json
$ composer install
$ npm install
$ npm run dev
$ php artisan clear-compiled
$ php artisan optimize:clear
$ php artisan package:discover
$ php artisan storage:link
$ php artisan migrate:fresh && php artisan db:seed // optional!
Then clear browser cache to be safe.
Open web inspector to see if you can see any errors.
Open latest laravel log in storage/logs/ folder to debug.
If all fails, install laravel-debugbar and see if you can debug there.

Laravel 5.4 RuntimeException] Directory name must not be empty

I'm just learning Laravel 5 and I am loving it.
I have an issue though, my php artisan command just stopped working all of a sudden. It shows this error
[RuntimeException]
Directory name must not be empty.
I am running on a windows10 pc . Thanks
Today I got the same issue while working on local environment, I really don't know how but my config folder was deleted automatically. Fortunately, I had backup with me and I simply re-add the config folder into my project and my site is back.
I think you need to update your composer like:
composer update
OR
composer update --no-scripts
after you can clear the cache
php artisan config:cache
php artisan config:clear
php artisan cache:clear

Resources