During the development of a chat application with React Native Expo, I encountered an issue when running "expo start" in my typical workflow. The error message displayed was "could not connect to development server."
If anyone has experienced a similar problem and has found a solution, any assistance would be greatly appreciated.
Prior to this error, I had recently integrated aws-amplify into the project, so initially I suspected that it might be the cause. However, the application launches correctly in the browser, but encounters issues specifically on the iOS simulator (Android just endlessly downloads but does not start).
Steps I've taken to troubleshoot:
1) Cleared cache using expo start -c
2) Attempted to address the error through npm start followed by reload commands.
3) Tried deleting port 19000 using the kill command to resolve any potential port conflicts. - Executed commands: • Npm install • Rm -rf node_modules/ && rm -rf yarn_lock/ && yarn install && cd ios && pod install
Unfortunately, none of these actions have resolved the issue, and I am currently out of ideas on how to solve it. All solutions found through research efforts have failed. Any additional suggestions would be highly valued.
Reference links for further context:
Could not connect to React Native development server on Android
Could not connect to the development server react native ios simulator Node
https://i.stack.imgur.com/pAX2c.png
Included portion of package.json file:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"-": "^0.0.1",
"@expo/vector-icons": "^12.0.0",
...
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@types/react": "~17.0.21",
...
},
"private": true
}