Failed to execute 'replaceState' on 'History': #<Object> with Sortable.js
See original GitHub issueVersions:
vue
version 3.0.5@inertiajs/inertia
version 0.9.0@inertiajs/inertia-vue3
version 0.4.0
Describe the problem:
Similar to here, I have this problem when using Sortable.js / VueDraggable: https://github.com/inertiajs/inertia/issues/730
app.js?id=f8cbfda01b9810c19e0f:2 DOMException: Failed to execute 'replaceState' on 'History': #<Object> could not be cloned.
at e.n.replaceState (/js/app.js?id=f8cbfda01b9810c19e0f:2:28191)
at e.n.saveScrollPositions (/js/app.js?id=f8cbfda01b9810c19e0f:2:21087)
at e.n.visit (/js/app.js?id=f8cbfda01b9810c19e0f:2:25155)
at onClick (/js/app.js?id=f8cbfda01b9810c19e0f:2:11402)
at At (/js/app.js?id=f8cbfda01b9810c19e0f:2:657430)
at Pt (/js/app.js?id=f8cbfda01b9810c19e0f:2:657508)
at HTMLAnchorElement.n (/js/app.js?id=f8cbfda01b9810c19e0f:2:708099)
Steps to reproduce:
Sort elements with sortable.js or Vue draggable and click on any Inertia link.
Similar to the linked thread, I can fix it by modifying the minified javascript file with this:
n.replaceState=function(e){this.page=e,e=JSON.parse(JSON.stringify(e)),window.history.replaceState(e,"",e.url)}
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Inertia and Sortable.js (VueDraggable) - Laracasts
Uncaught DOMException: Failed to execute 'replaceState' on 'History': #<Object> could not be cloned. at e.n.replaceState (webpack-internal:///.
Read more >Failed to execute 'replaceState' on 'History': #<Object> could ...
I have this Jetstream Laravel application, which has a presence channel set up for chat features. What's happening is: When I join the...
Read more >Uncaught DOMException: Failed to execute 'pushState' on ...
This error occurs, as @Andreas mentioned in a comment, when DOM elements or anything non-serializable is used in the state object which is...
Read more >5.4 Session history and navigation — HTML5 - W3C
History objects represent their browsing context's session history as a flat ... The pushState( data , title , url ) method adds a...
Read more >Domexception: Failed To Execute 'Replacestate' On 'History'
SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'file://0.0.1.148/. Culprit: /enUS/fbevents.js in History.b.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same issue. I fixed it by adding
After lots of work, I’ve found out that if you try to modify a prop directly in a component, it will cause this error. This tripped me up with object references (oh javascript). Cloning the prop I needed to do work on solved me issues.