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

Late to the party replying, but in your controller:
return Redirect::back()->with([
'data' => 'Something you want to pass to front-end',
])
Then on the front end:
this.form.post(route(...), {
onSuccess: (res) => {
this.form.data = res.props.data
},
})
this.form, in my case, is set as the following in data(){ ...
form: this.$inertia.form({
_method: 'PUT',
}),
(Adjust to your requirements)
data exists within the props response after a successful form update via Inertia. Helped me when I was digging around for an answer anyway.
This answer helped me get here, although not quite the same. Hope my answer helps!
Maybe your are using this.$inertia, it waits for Inertia response;
this.$inertia.get(route('example'))
.then(res => {
console.log(res)
})
Please use axios instead
axios.get(route('example'))
.then(res => {
console.log(res)
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With