Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix bizarre incorrect Laravel routing?

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!!!!

like image 943
PBB Avatar asked Nov 19 '25 11:11

PBB


1 Answers

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?

like image 60
Rolf Avatar answered Nov 22 '25 01:11

Rolf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!