Bug: Cannot read property 'status' of undefined
See original GitHub issueInertia doesn’t handle cases when a request fails without a response (e.g. no network).
In that case the error.response
is null.
https://github.com/inertiajs/inertia/blob/70b6bda4f23061558d48f91a95baaa9062b9e0bb/src/inertia.js#L83
Suggestion before line 83:
} else if (!error.response) {
Progress.stop()
// Should the user be notified somehow?
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property 'status' of ...
'Uncaught TypeError: Cannot read property 'status' of undefined' and it says that this is from sessionChecker. Can someone help me how to ...
Read more >Cannot read property 'status' of undefined · Issue #352
I got this error when testing over a secure connection. I fixed it by adding NODE_TLS_REJECT_UNAUTHORIZED=0 as an env var on the test...
Read more >Test Driven Development - Cannot read property 'status' of ...
I found the problem by putting console.log's in everything, and the POST function wasn't being triggered, although it was being triggered with ...
Read more >Axios - Cannot read property 'status' of undefined
Axios: Uncaught (in promise) TypeError: Cannot read property 'status' of undefined. Hello , When I use axios to create a model I have...
Read more >TypeError: Cannot read property 'status' of undefined
Hello! I'm trying to use the Metadata Manager for the first time and all was going well until I tried to make the...
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 FreeTop 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
Top GitHub Comments
Thanks for reporting this. I agree, we need a better solution here. I plan to get back into some serious Inertia development in June, and I’ll try and tackle this at that time. 👍
So I believe this has been corrected now. In the event that there is no response, the promise will simply fail, without causing another error.
Plus, you can now catch these errors using the new event system: