question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot connect to the server with the iOS simulator

See original GitHub issue

I have a server running at localhost:5000, and I’m using then http-proxy-middleware to connect my development client like so:

const proxy = require('http-proxy-middleware');
module.exports = function(app) {
    app.use(proxy('/auth/google', 
        { target: 'http://localhost:5000/' }
		 ));
    app.use(proxy('/api/*', 
        { target: 'http://localhost:5000/' }
    ));
}

But the proxy isn’t working. I get the following:

Error: Unable to resolve module `./debugger-ui/debuggerWorker.d9da4ed7` from ``: 

None of these files exist:
  * debugger-ui/debuggerWorker.d9da4ed7(.native|.native.expo.ts|.expo.ts|.native.expo.tsx|.expo.tsx|.native.expo.js|.expo.js|.native.expo.jsx|.expo.jsx|.native.ts|.ts|.native.tsx|.tsx|.native.js|.js|.native.jsx|.jsx|.native.json|.json|.native.wasm|.wasm)
  * debugger-ui/debuggerWorker.d9da4ed7/index(.native|.native.expo.ts|.expo.ts|.native.expo.tsx|.expo.tsx|.native.expo.js|.expo.js|.native.expo.jsx|.expo.jsx|.native.ts|.ts|.native.tsx|.tsx|.native.js|.js|.native.jsx|.jsx|.native.json|.json|.native.wasm|.wasm)
    at ModuleResolver.resolveDependency (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:163:15)
    at ResolutionRequest.resolveDependency (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/node-haste/DependencyGraph.js:282:16)
    at /Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/lib/transformHelpers.js:267:42
    at /Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/Server.js:1305:37
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/Server.js:99:24)
    at _next (/Users/prikshetsharma/Documents/vendo/client/native/node_modules/metro/src/Server.js:119:9)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

[Unhandled promise rejection: Error: Network Error]
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:154704:26 in createError
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:154606:27 in handleError
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:32436:31 in dispatchEvent
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:31520:33 in setReadyState
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:31347:29 in __didCompleteResponse
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:7023:42 in emit
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:2774:49 in __callFunction
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:2487:31 in <unknown>
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:2728:15 in __guard
* http://127.0.0.1:19003/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:2486:21 in callFunctionReturnFlushedQueue
* [native code]:null in callFunctionReturnFlushedQueue
* http://localhost:19003/debugger-ui/debuggerWorker.d9da4ed7.js:4:907 in <unknown>

Why might this be?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:9

github_iconTop GitHub Comments

7reactions
ebaynaudcommented, Jan 16, 2020

Got stuck with this exact issue for hours. Just found that this occurs only on device where app is already installed with debug mode enabled.

I fixed it by:

  • uninstalling manually app from device (cmd+H to display simulator home) then long click on app icon and click on cross to delete app => this forces disabling debug mode,
  • then run app again from xcode.

Enabling debug mode after that works normally.

3reactions
garrettmcommented, Jan 28, 2020

I have this issue right now on Android, reinstalling the app doesn’t seem to fix it. RN 0.61.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simulator refuses to connect to *.… | Apple Developer Forums
It has nothing to do with Xcode. This is a bug in the iOS Simulator runtime. You should just use the workaround that...
Read more >
iOS simulator cannot connect to development server
I am developing on MacOS XCode 12.3, simulator iOS 14.3 attempting to connect to a development server on a machine on the local...
Read more >
Zscaler proxy + iOS Simulator + iOS Development (failing to ...
Our custom react native application fails to connect to a test server via ios simulator. I have narrowed this down to the proxy...
Read more >
VS 2019 16.9.4 cannot connect to iOS Simulator Xcode 12.5
4.0.app. Then go to Tools / iOS Settings / Xcode path and set it to the path to 12.4. You'll also need to...
Read more >
My Remote Devices (iOS/Android) could not connect to ...
1. Problems · 2. Solution · 0. Issue with iOS 16 Physical Devices / Simulator · 1. Make sure your mac device and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found