无法执行替换效果'在历史上':#< object>无法克隆

发布于 2025-01-27 17:09:11 字数 369 浏览 4 评论 0原文

我有这个Jetstream Laravel应用程序,该应用程序具有用于聊天功能的存在频道。

发生的事情是:

当我加入频道并在此处发送消息时,一切正常,除非我尝试退出频道。在每个导航链接中,错误未知的domexception:未能在“历史>”上执行“替换”: #< object> 无法克隆。是触发的。

不确定是什么原因引起的...

奇怪的事实:

当我加入频道并留下它时,无需发送任何消息时就可以按预期工作。我访问我应该访问的页面,没有任何错误。

I have this Jetstream Laravel application, which has a presence channel set up for chat features.

What's happening is:

When I join the channel and send a message there, everything works fine, except when I try to exit the channel. In every navigation link, the error Uncaught DOMException: Failed to execute 'replaceState' on 'History': #<Object> could not be cloned. is triggered.

Not sure what is causing it...

Curious Fact:

When I join the channel, and leave it, without sending any message, it works as expected. I visit the page that I was supposed to visit, without any error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌生 2025-02-03 17:09:11

您不应更改来自$ page.props.props。{propname}的道具,

而不是要在诸如应用程序{messages}之类的道具上进行一些更改,

则应创建一个新对象或数组从道具:

const messages = ref([...page.props.value.messages]);

现在您可以根据需要更改消息对象:

messages.push(newMessage)

You should not change the props who is coming from $page.props.{propName}

Instead if you want to make some changes on a prop like your app {messages}

you should create a new object or array from the prop:

const messages = ref([...page.props.value.messages]);

Now you can change the messages object as many as you want:

messages.push(newMessage)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文