Skip to content
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

ERROR: window.history.state is null #713

Open
andrewperoramas opened this issue Feb 7, 2025 · 8 comments
Open

ERROR: window.history.state is null #713

andrewperoramas opened this issue Feb 7, 2025 · 8 comments

Comments

@andrewperoramas
Copy link

I use SSR.
I use inertia v2
I use laravel octane

What's causing this? I can't see any fix in google.

Image

@im-aeo
Copy link

im-aeo commented Feb 8, 2025

I have the exact same thing happening to my site. I assume its a global issue.

@andrewperoramas
Copy link
Author

I have the exact same thing happening to my site. I assume its a global issue.

did you manage to fix it?

@andrewperoramas
Copy link
Author

andrewperoramas commented Feb 14, 2025

clicking on an anchor tag trigger this error.

<a href="#" onClick> </a>

I removed it and it fixed the problem.

@mreduar
Copy link

mreduar commented Feb 25, 2025

I'm having a problem similar to this
Image

in fact the error occurs because window.history.state is null.
Image

@andrewperoramas
Copy link
Author

I'm having a problem similar to this Image

in fact the error occurs because window.history.state is null. Image

Yeah, I'm still randomly getting this error. I'm not sure how to reproduce it. When this error occurs, it freezes the site, and I can't navigate to any links.

@mreduar
Copy link

mreduar commented Feb 25, 2025

I think the error is related to this one.
inertiajs/inertia#2204

@milanchymcak
Copy link

@andrewperoramas I had the same issue with scrollRegions and fixed it like this for now, in your app.tsx:

if (!window.history.state) {
    window.history.replaceState({ scrollRegions: [] }, '');
}

@im-aeo
Copy link

im-aeo commented Mar 3, 2025

@andrewperoramas I had the same issue with scrollRegions and fixed it like this for now, in your app.tsx:

if (!window.history.state) {
window.history.replaceState({ scrollRegions: [] }, '');
}

I'll have to try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants