Could not connect to development server. - Expo - javascript

I am attempting to get a mobile app to run using expo and whenever I run the simulator I get the following error.
One of the recommended solutions is to set the URL correctly in AppDelegate, and I have already tried to find this file and look at solutions on the web but I cannot even find the AppDelegate.m file to do this.
Do you know where it is and how I could update the file to fix my code?
Thank you!
Could not connect to development server.
Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
- WiFi is enabled and connected to the same network as the Node Server
URL: http://192.168.1.90:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false
ABI44_0_0RCTFatal
__37-[ABI44_0_0RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_sim
0x0

Related

How to stop a NodeJs file on Ubuntu server

I paid someone to install a Js script on my server
but when i tried making some changes on scripts/files i just couldnt see the changes on browser
while browsing and googling for like 24 hours i figured out that js scripts should be restarted in order to show the result on browser
and i figured out that in order to start a node js file i should type in terminal
node /dir/example.js
but can someone help me how to refresh/restart it
Iam stuck here like 24 hours
please help
I just want to let you know too that iam using Putty software in order to connect to the ubuntu server, ubuntu version is 20.04
EDIT: you will need an ssh connection to your server with access to a terminal..
Your node.js scripts, if they are on a server, should typically be ran using a process manager such as pm2.
Try to type pm2 list in a terminal. If you see some information you have hit the spot. Just after that run pm2 restart id. id being the number of your process and your changes should be visible.
You can just try this or try your luck with other process managers that run on your server providers. Just read what your server provider recommends for default and usually your previous developer would have used it.

Move my MERN app (developped on windows) on a ubuntu machine and access it via LAN network

It's my first time here so please bear with me :)
Basically i developped a full stack MERN web application on my windows 10 machine (node js, express js and Mongodb in the backend + database and react js for the frontend), to run each one of them for now i use vscode (nodemon server for the backend and npm start for the front) all are running on my localhost on different ports.
what i need to do is to move that MERN app to an ubuntu machine and make it accessible via LAN network of that ubuntu continuously.
i guess i need to use git to move the app from windows to ubuntu? (correct me if i'm wrong) but how to make it run correctly there? and should i install a specific server to run it all on the LAN?
Thank you for the help in advance !

Why am I getting an error when trying to run a new react native project

I have created a new react native project by running "react-native init MyFirstProject". I have also installed node and have added no code of my own to any of the files.
I have tried to run the project to make sure it works by running "react-native run-ios --simulator="iPhone 8"". The command runs successfully but I am given the following error.
Could not connect to development server.
Ensure the following:
Node server is running and available on the same network - run 'npm start' from react-native root
Node server URL is correctly set in AppDelegate
WiFi is enabled and connected to the same network as the Node Server
URL: http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false
RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
__CFRunLoopRun
CFRunLoopRunSpecific
Blockquote
GSEventRunModal
UIApplicationMain
main
start
How do I fix this error?
Try opening your project ios/MyFirstProject/MyFirstProject.xcworkspace and see if there's any build error.
I ran into this problem too, with the same error:
RCTFatal __28-[RCTCxxBridge handleError:]_block_invoke
It turned out that I had another server running on my local machine on the same port that the expo development client server was running (:8081), and that it was taking priority and then obviously giving the client a very different response to what it was expecting. Quitting the other server fixed the problem.

ReactNative port 8081 issue : 403 Forbidden

While developing using ReactNative on Windows, I am getting below 403 error. This is because port 8081 which ReactNative uses by default is being used by another program. In my case it was McAfee (Thanks McAfee for making this harder).
Command to run the project : react-native run-android
I searched around a lot and finally figured out how to run this project on a different port. If you have any Antivirus software installed then it may help if you disable the firewall while developing or allow connections manually through settings.
Start ReactNative on a different port
react-native start --port 9080
This will open a new command prompt and start the metro bundler on port 9080 (you can use any other port you want). Wait for the dependency graph to be fully loaded.
Now in a different command prompt (project directory) use the below command to build and install the app on device
react-native run-android
Now once the app is loaded on device you will see the 403 error along with the red screen. To make the device communicate on a different port use below command.
adb reverse tcp:8081 tcp:9080
or if you have multiple device connected then provide the device id (e.g. FA6AA0301277)
adb -s FA6AA0301277 reverse tcp:8081 tcp:9080
To know the list of devices connected use below command
adb devices
That's it, now you should be able to see the index page :)
Happy Coding :)

Red Screen React Native Reference Error : Can't find variable : _fbBatchedBridge

I followed the steps mentioned in following documents and everything runs perfectly.
https://facebook.github.io/react-native/docs/getting-started.html
https://facebook.github.io/react-native/docs/android-setup.html
https://facebook.github.io/react-native/docs/running-on-device-android.html
Now am trying to run the android app on my device but I get below error.
I tried following to resolve the issue:
react-native start > /dev/null 2>&1 &
adb reverse tcp:8081 tcp:8081
If I try to run without a server, bundle the jsfile into the apk by running:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
I get
I followed all the steps outlined in this question react native android failed to load JS bundle but still I am not able to resolve the issue.
I am using my smartphone's data plan on my OSX machine via hotspot. I entered my machine's IP address inet 192.168.43.14 along with port 8081 in the react-native developer setting.
Any idea what am missing here?
Device details:
OSX El Capitan 10.11.1
Nexus 5(Rooted) 6.0.1
Node - v4.2.1

Categories

Resources