I am building a simple website in Laravel 6. I used the built in Laravel artisan tools to create authentication routes and views.
After logging in, a user should be redirected to /home. However, every now and then Laravel will redirect to /js/popper.js.map
I have no idea why Laravel is doing this! I have scoured error logs, to no avail. I am using Bootstrap, but I never explicitly told Laravel to import or use Popper. I have no idea why it specifically wants to go this specific file?? I've had this problem for weeks.
Sometimes running php artisan config:cache and cache:clear help, but not always. Furthermore, it sometimes will happen on my remote server, or on local, but often not at the same time, making it very hard to debug.
I have declared the Auth routes with the built in Laravel Auth. Like so:
php artisan ui bootstrap
And in web.php:
Auth::routes();
I expect logging in to redirect to /home, which then redirects to welcome/red (part of my software). Instead, it gets stuck at js/popper.js.mapand 404s. Logging in WORKS, and I can access authenticated content. But it's a bad user experience to get stuck in a 404 page for no reason.
Does anyone have any clue where Laravel is getting the idea to redirect to /js/popper.js.map? Thank you!!!!
I’ve never had this issue. Maybe you could start with a simple controller and view? Without any assets and packages loaded? From that point add packages and assets one by one. You should find your bug. And did you write any tests? That should help a lot!
And I assume this popper.js file is loaded by a npm package? Maybe it helps to uninstall it?
Related
I have a strange error in my Laravel(5.6)/app. Whenever there is any route request in the app, all css, js, bootstrap and icons files reload all over again in the browser. I'm debugging this app from last 2 days. And I have no clue what's going on.
I worked on this project a few days ago and it was working fine then I started working on some other project and after a couple of days when I worked again on this project to add some new features, it is behaving like this. Whenever I request any route in the app, all the assets download and load again in the browser. I didn't provide any code sample here because I don't know where the error might be.
If there have been an error in some particular file then that particular route would have behave that way. But all routes reload all the assets all over again. So I just want your opinion is this ever happens to you and how should I tackle it?
If you wanna recreate this project then here is the GitHub link. Git Repo . Recreating this project is very easy. Just create a database. run migrations and then seed the database. For sass and js ,run 'npm run dev' if needed.
Update: Solution to this problem is, don't use buit-in server of laravel, it sucks. Use any php development stack like xampp, wamp etc. and it will work fine.
Im working on a existing project, which uses symfony to provide web services. I'm new to Symfony technology but I have good experience in Laravel, the project has an issue in JwtAuthenticator.
Symfony\Component\Debug\Exception\ClassNotFoundException
Attempted to load class "JwtAuthenticator" from namespace
Thing is this issue does not occur in windows OS, but while working in linux Ubuntu it occurs, so far what I found is that the cache data seems to trouble, also unable to delete them without changing the folder access permission to 777. But once if it is given full access permission and if the cache folder is emptied then application runs without error, but from the next request it again happens. So if removing files in cache is done then it works.
Here, JwtAuthenticator is used to provide authentication verification
Can anyone help me to solve this.
So I have been working on Laravel projects with no issues at my new job, however I decided it was time to get it up and running on my system at home which for purposes of this question is running MS Windows 10. I managed to get it all set up correctly, however upon trying to get the test app working just to make sure everything was correctly configured, I am unable to get passed the laravel welcome (welcome.blade.php) despite having the Routes.php file in place.
The clean project was git cloned directly from laravel/laravel and I had no issues with this working on my work computer when I very first started learning Laravel. I'm not getting any errors, the routes are simply not working!
Btw I had to create the Routes.php file manually for some reason, even though I created my migrations and did:
artisan migrate
The views directory I created called 'testview' is being completely ignored in the routes file when calling:
Route::get('/', 'TestController#index');
Controller code:
Return view('testview.index');
That is within the public function index() just for those who try to be smart and say "oh but you didn't have it contained within a method".
Please could someone help and tell me where I'm going wrong??
It seems that for some reason the version of laravel on GIT is out of date as I peformed a different command line action using Composer and that installed the latest version. So in closing I've sorted this out myself, thanks.
I've been using Laravel for a while, have gone through a few projects, and never experienced this:
Suddenly my application was having TokenMismatchException and creating new sessions between requests.
After hours of searching for a solution, and tried every session driver i tried to use XAMPP instead of Laravel's built-in server.
php artisan serve / http://localhost:8000
with XAMPP:
http://localhost/myproject/public
And then the CSRF persisted as well as the sessions, and every session driver started to work fine once again.
Strangest thing is, i tried to use php artisan serve again and the problem went away.
I thought i should stick to php artisan serve, but now i'm starting to guess.
Does anyone have a clue about this strange behavior? so we can save people from this headache. Thanks in advance
As a temporary workaround always open your browser in Incognito or Private mode when using php artisan serve
I'm booting up a development server for my laravel project with:
php artisan serve --port=3030
The issue is that the response time is way too long (~17 seconds). Chrome dev tools are saying the routing to the index method is the issue but, I'm only attempting to retrieve a basic view.
Does anyone have any advice? This is an issue on all my laravel projects on my work machine.
Appreciate any response,
Sam