Unhandled promise rejection: Error: Request failed with status code 500

Hello everyone,
I am creating an app and for the login I am fetching the user data data via axios from my server.
Everytime I try to login I get this error:

[Unhandled promise rejection: Error: Request failed with status code 500]

  • node_modules\axios\lib\core\createError.js:15:17 in createError
  • node_modules\axios\lib\core\settle.js:16:9 in settle
  • node_modules\axios\lib\adapters\xhr.js:60:6 in handleLoad
  • node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
  • node_modules\react-native\Libraries\Network\XMLHttpRequest.js:592:4 in setReadyState
  • node_modules\react-native\Libraries\Network\XMLHttpRequest.js:395:6 in __didCompleteResponse
  • node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:189:10 in emit
  • node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
  • node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0
  • node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
  • node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue
  • [native code]:null in callFunctionReturnFlushedQueue

This is how I implement axios:

const response = await axios.get(endpoint+this.state.user + this.state.passwort);
const results = JSON.stringify(response.data);
(endpoint is the url)

Please run expo diagnostics and paste the log that’s printed out along with your question or issue:
Expo CLI 4.2.1 environment info:
System:
OS: Windows 10 10.0.19042
Binaries:
Node: 15.10.0 - C:\Program Files\nodejs\node.EXE
npm: 7.5.3 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 29
Build Tools: 30.0.3
System Images: android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
npmPackages:
expo: ~39.0.2 => 39.0.3
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz => 0.63.2
react-native-web: ~0.13.12 => 0.13.18
Expo Workflow: managed

If the request failed with status code 500 that means a failure on the server side. So your request is going ok but there is no response because the server failed on giving a response back.

That can’t really be the case, because when I enter the url directly into the browser I get the data

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.