Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
702 views
in Technique[技术] by (71.8m points)

caching - Laravel Livewire App not working after clearing cache

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.

enter image description here

question from:https://stackoverflow.com/questions/66050083/laravel-livewire-app-not-working-after-clearing-cache

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...