Closed fengzi91 closed 3 years ago
Can you should me the response you're getting in the browser that's causing this?
HTTP/1.1 302 Found
Host: localhost
Date: Wed, 09 Jun 2021 12:16:48 GMT
Connection: close
X-Powered-By: PHP/8.0.5
Cache-Control: no-cache, private
Date: Wed, 09 Jun 2021 12:16:48 GMT
Location: http://localhost/register
Content-Type: text/html; charset=UTF-8
Set-Cookie: XSRF-TOKEN=eyJpdiI6IlZ2YTJ4MmhERjNPUGlReS9ZTFlzVGc9PSIsInZhbHVlIjoiUHo1WXBtOURUZHZQVUJNNDAzRmpiSkRLUi9aci9SeThVdERWN0tqNEpHb291cXpPTkZSNjhvN1lSTlp4aHJqRTRsWDNQV1VxR0dzcjZKcmVTSWc2U0h1Ujl2VjhDQkpZNklkZHc3dnRBdjYyWXlaRlRRWnhzaXNKSkwxY3o0a2MiLCJtYWMiOiI5NTBmNTE5MTNiMWQ5MTYxOGIwOTMxNmJlNDg3MTg1Njc1Y2FlYTUzNmU3ODA0ZGY0MmNmNzJhZDNmN2JlYmJmIn0%3D; expires=Wed, 09-Jun-2021 14:16:48 GMT; Max-Age=7200; path=/; samesite=lax
Set-Cookie: laravel_session=eyJpdiI6Ik9WM2pvOUJKMlRteTlyeG9qUjQ1YVE9PSIsInZhbHVlIjoiT3pabm1IazhrQmZuVjZSOXUzeWlBSXVIa05FYk1wQkY4bXh5a1htSmFCL01PaUVNcTlDKzdUbkNYckYyaWhKb1lNTktKbTJxNnNLWStGYUJjSlNXaWZIL0o1QStpbCtSMVFVTEMrY09TdUNFZmlVSEkwZnlyQXZWcEtYRE9FaWkiLCJtYWMiOiI1Y2IyODUxNjM1ZDJjMTc0MDBiYzA0ODhkMjQ1NDZjYTVmN2YwMTdhMDYxNGY3MWFhNTAwNWExMzZjODRmYzc4In0%3D; expires=Wed, 09-Jun-2021 14:16:48 GMT; Max-Age=7200; path=/; httponly; samesite=lax
HTTP/1.1 200 OK
Host: localhost
Date: Wed, 09 Jun 2021 12:16:48 GMT
Connection: close
X-Powered-By: PHP/8.0.5
Vary: Accept
X-Inertia: true
Cache-Control: no-cache, private
Date: Wed, 09 Jun 2021 12:16:48 GMT
Content-Type: application/json
Set-Cookie: XSRF-TOKEN=eyJpdiI6IkNpZHZhcm5aZkYvb1lYclRrUEJZdXc9PSIsInZhbHVlIjoiWEphYUxVamZkRmMvVmhwOXJQdVU3QWQxT2kxVEdjVU5XRzJ5dDYzREJXSS9IeUVaNzJ5NTRKUkZ3djUrOUlqaGNLdU1sRXZmQUo0Szd6a0hOTGdVWmd0VTJWQ1ZtRzRnNkpxbERvWXNxbWZ5eDFPWi8zbjhEczVrOHRCRFhGdXAiLCJtYWMiOiJlOTI1ODA3OGNjNWRhYWQ5NmYyMDIwNDgxOTA0NmI3ZTNmMzE5M2YxOWI5MGE4MjgwMWFhZTIxOTI3ZjdmMGYxIn0%3D; expires=Wed, 09-Jun-2021 14:16:48 GMT; Max-Age=7200; path=/; samesite=lax
Set-Cookie: laravel_session=eyJpdiI6IjdWQ1NHaEJIRmxmS09JR2Yvdncrb1E9PSIsInZhbHVlIjoiRGxQUU91MUZ3KzFVSFczTC9Wd29KWTliV3NTUEg3a2tVdXNRYVp5LzhNM2pMTFVCMWk0UUVDNmNPLzJwaml6VmN0Q0wweStsZTdoZTY4cGRjczdiY21oWUt1MnI5WE1uM09qTC9idkk0aW5pOWk2YzBPUFhzUDVuWDc5b0hEVjMiLCJtYWMiOiI5N2ZhZDg1OTk2M2VkNDI3NWFlNTc5NzAwYjhjN2NhMzdmOGJmMTdmOGZhYTFhMDAwNDY4M2Y2OGJhNjgzMjJjIn0%3D; expires=Wed, 09-Jun-2021 14:16:48 GMT; Max-Age=7200; path=/; httponly; samesite=lax
And the body?
{
"component": "user/register",
"props": {
"errors": {
"phone": "phone error",
"captcha": "captch error"
}
},
"url": "/register",
"version": "b88130e1b7b4f22ec36961f3f2596e02"
}
Here is an example that can reproduce the error https://github.com/fengzi91/inertia-laravel
😂
I changed the axios response, but forgot to use axios.create()
, so I got this error
Glad you got it figured out. 👍
When the form vaildate fail, I got error in browse console, like this 'index.js?5b3d:1 Uncaught (in promise) TypeError: Cannot read property 'x-inertia' of undefined at Object.isInertiaResponse'