Issue encountered with connecting to development server on Expo iOS simulator that is not present when using a browser

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
}

Answer №1

Encountering the same problem while using amplify has been a challenge for me as well.

In addition to checking the expo console, make sure to also pay attention to the terminal output.

If the terminal indicates duplicate files in your project, remove one of them and perform a cache clear and restart using the command expo start -c.

It seems that amplify's backup file creation may confuse expo into thinking there are duplicates present.

Although clearing the cache worked in this case, it is not guaranteed to be the definitive solution.

If this method resolves the issue for you, it would bring me great satisfaction.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unexpected TypeScript issue: Unable to access the 'flags' property of an undefined entity

Upon creating a new project and running the serve command, I encountered the following error: ERROR in TypeError: Cannot read property 'flags' of undefined Node version: 12.14 NPM version: 6.13 Contents of package.json: { "name": "angular-t ...

In Vue3, when using the `script setup` with the `withDefaults` option for a nested object, its attributes are marked as required. How can this issue

I have defined a props object with certain attributes: interface Props { formList: BaseSearchFormListItemType[], inline?: boolean searchBtn?: { show?: boolean text?: string type?: string size?: string } } const props = withDefaults( ...

Exploring the capabilities of Google Cloud Storage JSON API in a React-Native application integrated with Cloud Functions

At the moment, our application is accessing Google Cloud Storage directly from the client-side, resulting in a storage of sensitive data on the client-side. I've spent the last three days attempting to utilize the Google Cloud JSON API without success ...

You are unable to utilize ScrollView within BottomSheet in React Native

After developing a search feature and page in my app, I encountered an issue with displaying content in BottomSheets. Despite using a DataTable, I found that a ScrollView cannot be nested inside the BottomSheet, resulting in not all content fitting vertica ...

What is the process of launching an Angular component in a new browser tab?

I have a large amount of data that needs to be displayed on the screen in a simplified list format for users to choose an item and view its details. Consider a component called SimpleListComponent, which will store the data and present a condensed view: ...

Experiencing "localhost redirect loop due to NextJS Middleware" error

After successfully integrating email/password authentication to my locally hosted NextJS app using NextAuth, I encountered an issue with the middleware I created to secure routes. Every time I tried to sign out, I received an error stating "localhost redir ...

Is there a way to update the data on a view in Angular 9 without the need to manually refresh the page?

Currently, I am storing information in the SessionStorage and attempting to display it in my view. However, there seems to be a timing issue where the HTML rendering happens faster than the asynchronous storage saving process. To better illustrate this com ...

Error: Cannot access property 'tb' of an undefined value

While running the Application, I encountered an error in the declaration of constants.ts file where I was assigning data from a json file to constant variables. In the json file named object.json, I had some data structured like this: { "furniture": { ...

Is there a way to implement hover behavior for a Material-UI Button within a ButtonGroup component?

When using MUI v5, I am encountering an issue where the first button in the code provided is only half working. The button is initially colored red (both the border and text), however, upon hovering over it, the color of the border changes to blue. This is ...

Retrieve a specific value from an array within Firestore

I am facing an issue where I can only retrieve the values I need from the array by adding a specific string like "اقلام" or "سبورة". However, I want the value to be passed as a prop from another component or screen. Is there a way to resolve this ...

The Vue CLI build is displaying a blank page when hosted on an Apache server

I encountered an issue with vue cli. Running npm run serve went smoothly, but when I tried dev mode using npm run build-dev, the build process finished with a blank page displayed. The error message received was "Uncaught SyntaxError: Unexpected token &ap ...

Directive for creating a custom loading indicator in Angular

I have created a custom Angular element directive that displays and hides a loading indicator based on a condition from a service call. The directive is used as an element within another element. While the directive itself works correctly, the issue is tha ...

Is there a way to see the countdown timers in Angular 7?

Is there a way for me to view my timer's countdown as it starts? I have attempted to bind it to a variable, but all I see is [object Object]: setTime(time) { if (this.settime >= 5 ) { this.currentTime = time; this.alerttime = thi ...

Using aliased imports is no longer an option when setting up a new TypeScript React application

Upon creating a new React-typescript app using the following command with <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3143545052457100061f011f03">[email protected]</a> and <a href="/cdn-cgi/l/email-protectio ...

Node utilizes various package versions depending on the environment

I am looking to selectively install specific package versions for different deployment environments in my node application. For the development environment, the dependencies should be as follows: "dependencies": { "bootstrap": &qu ...

Guide to invoking SOAP WCF web services with the ws.js or wcf.js node packages

I recently installed the soapjs module and attempted to access its services. One of the services I encountered contains complexContent, which can be found at: I am curious if it is possible to retrieve the details of a WCF service's wsdl including m ...

Ways to decrease the size of this item while maintaining its child components?

Here is an object that I am working with: { "name": "A", "children": [ { "name": "B", "open": false, "registry": true, "children": [ { ...

Why did my attempt to build an Ionic 3 app for production fail? I am struggling to comprehend the reason behind this issue

When attempting to build my ionic v3 application for production, I used the following command: ionic cordova build android --prod --release However, the build process failed and resulted in the following error: [02:27:35] ngc started ... [02:27:40] i ...

Learn how to add the SASS version of Bootstrap to your project using NPM without including the JavaScript files

Currently, I am undertaking a project that requires the use of Bootstrap's CSS via Sass, without the need for JavaScript. Although including bootstrap-sass through NPM is not an issue, all the unnecessary JS files are causing clutter as they serve no ...

I encountered an error while trying to load a resource: the server returned a 404 (Not Found) response in Ionic2

Everything was running smoothly with my project until yesterday. For some reason, when I try to “ionic serve” the project, I keep encountering this error message. Error Message When Running Ionic Serve To make matters worse, after checking my build f ...