-
-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox Page Reload Bug #2092
Comments
Hello @Verox001 i try a few different applications with Inertia and I could not reproduce this bug with Inertia + Rails. Can you share more information please or maybe share the website in production. |
<?php
namespace App\Http\Middleware;
use App\Http\Resources\UserResource;
use App\Models\ExchangeRate;
use App\Models\UserAffiliatedUser;
use Illuminate\Http\Request;
use Inertia\Middleware;
use Tightenco\Ziggy\Ziggy;
class HandleInertiaRequests extends Middleware
{
/**
* The root template that is loaded on the first page visit.
*
* @var string
*/
protected $rootView = 'app';
/**
* Determine the current asset version.
*/
public function version(Request $request): string|null
{
return parent::version($request);
}
/**
* Define the props that are shared by default.
*
* @return array<string, mixed>
*/
public function share(Request $request): array
{
$loggedIn = auth()->check();
$user = auth()->user();
return [
...parent::share($request),
'auth' => [
'user' => $loggedIn ? new UserResource($user, null) : null,
],
'locale' => $loggedIn ? $user->locale : session('locale'),
'theme' => $loggedIn ? $user->theme : session('theme'),
'ziggy' => fn () => [
...(new Ziggy)->toArray(),
'location' => $request->url(),
'name' => $request->route()?->getName(),
],
'route' => $request->route()?->getName(),
'flash' => [
'success' => session('success'),
'error' => session('error'),
'warning' => session('warning'),
'info' => session('info'),
],
];
}
} Yeah, sure. This is the site: https://cimeyclust.com/ (not finished due to reasons specified above 😅) If you need anything else, please let me know! |
@PedroAugustoRamalhoDuarte Hey, just following up on something: The issue doesn't occur if I use the normal router.reload function, but only my custom one, which makes sure that no loading overlay is shown. Maybe there's something wrong with it?
|
Hello @Verox001, sorry for the late response. This is a very strange bug—I was able to reproduce it here as well, but only with Firefox. It’s quite challenging to debug in this way. Perhaps it would be better to open a help request in the Discord forum: https://discord.gg/K2F34GC3. It’s likely an issue specific to your application and not related to Inertia, but it’s certainly odd that it only happens in Firefox. |
It's something related to your session cookies. When I delete them, I can reproduce the error, but when the cookies are present, it works normally. |
Version:
@inertiajs/react
version: 1.2.0Describe the problem:
Everytime when I'm trying to access my page via Firefox without having cached anything, the page reloads quickly a few times or so, which is really annoying. It both happens locally and in production, but only on Firefox.
Steps to reproduce:
Setup an Inertia application (I'm using Laravel with these configs):
vite.config.ts
app.tsx:
Try accessing the site over Firefox an you'll notice the weird reloading hehaviour. (You can use any React component for testing)
If you need any more details or if anyone else has this issue, please let us know!
The text was updated successfully, but these errors were encountered: