所有的 Inertia 请求都必须收到一个有效的 Inertia 响应,但是收到了一个普通的 JSON 响应 [英] All Inertia requests must receive a valid Inertia response, however a plain JSON response was received

查看:23
本文介绍了所有的 Inertia 请求都必须收到一个有效的 Inertia 响应,但是收到了一个普通的 JSON 响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图理解并解决这个 InertiaJs 错误,但没有成功,我希望我能在这里得到一些帮助.

i am trying to understand and resolve this InertiaJs error without success i hope i can get some help here.

推荐答案

也许你正在使用这个.$inertia,它等待 Inertia resopnse;

Maybe your are using this.$inertia, it wait for Inertia resopnse;

this.$inertia.get(route('example'))
  .then(res => {
     console.log(res)
  })

请使用 axios.代替

Please use axios. instead

axios.get(route('example'))
  .then(res => {
     console.log(res)
  })

这篇关于所有的 Inertia 请求都必须收到一个有效的 Inertia 响应,但是收到了一个普通的 JSON 响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆