Server-side debugging for Meteor App on Nitrous.io - javascript

I've got a simple Meteor app running on a Nitrous box. I'd like to be able to use node-inspector for server-side debugging (as described here), but I'm unable to get to the console.
My Meteor app is running locally on the box at http://0.0.0.0:3000/, and I can view it in Chrome by following the guide here. When I then run node-inspector, I get this message:
Node Inspector v0.8.3
Visit http://127.0.0.1:8080/debug?port=5858 to start debugging.
How can I get to this address? I've tried:
Navigating to https://example-name.example-region.nitrous.io:8080/debug?port=5858
Running: node-inspector --web-host 0.0.0.0
Running: node-inspector --web-host https://example-name.example-region.nitrous.io
Thoughts? Is there a way I can get to this console?

You should change the url on the box,
usually you just run the box running the meteor command
cd workspace
cd myAPP
meteor
and it works, but now you should run this commands.
cd workspace
cd myApp
ROOT_URL=http://machinename.abc1-2.nitrousbox.com meteor
Now run again node-inspector
you should get something like
Visit http://machinename.abc1-2.nitrousbox.com:8080/debug?port=5858 to start debugging.

Related

React app server not running on 127.0.0.1

I've recently built a project using create-react-app. Everything is fine until today.
I run npm start as usual and try to visit http://localhost:3000. But I got LOCALHOST REFUSED CONNECTION error. And I got this on terminal's output in vscode.
Local: http://localhost:3000
On Your Network: http://172.24.194.157:3000
I made a small test: using vite to create a react app and npm run dev. And it's just fine to visit http://localhost:5173.
At first I thought it might be a problem with port. But turns out not. Because http://172.24.194.157:3000 is ok to develop my react-app.
So I guess, my browser resolute localhost to 127.0.0.1, but 127.0.0.1:3000 is not available due to react-scripts start serve the app on 172.24.194.157:3000.
But WHY is that happen? I made no changes to any config.(though I didn't open this project for about 2 weeks). It would be a great help if anyone can answer this. Thanks!
ENV INFO:
wsl1 in windows 11 (Ubuntu 20.04)
node: v16.9.0
npm: 8.19.3

Vue app compiles successfully but does not load in browser

I have a Vue app that outputs the following in the console after npm run serve.
DONE Compiled successfully in 17450ms 2:15:55 PM
App running at:
- Local: http://localhost:8080/
- Network: http://10.0.0.72:8080/
Note that the development build is not optimized.
To create a production build, run npm run build.
No issues found.
However, the app will not load on http://localhost:8080/ . The page displays the "This site cannot be reached.The connection was reset." message.
Other pages load fine, including the Node server I am using for the backend, running on localhost:3002.
I have tried removing the node_modules and running npm install again, but that hasn't fixed it. With the app compiling ok there is little help troubleshoot. There are also no errors in the browser dev tools console.
Does anyone know what might be going wrong or how to debug this?
Thanks!
change your port with npm run serve --hostname 0.0.0.0 --port 4000 and then run again.

React Native, Failed to launch emulator. Reason: No emulators found as an output

I'm trying to run my react native app in emulator by using command react-native run-android but it's throwing that error
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 44s
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync /Opt/Android/platform-tools/adb ENOENT
info Starting the app...
The system cannot find the path specified.
error Failed to start the app. Run CLI with --verbose flag for more details.
Error: Command failed: /Opt/Android/platform-tools/adb shell am start -n com.reactproject/com.reactproject.MainActivity
at makeError (C:\Users\Danger World\ReactProject\node_modules\execa\index.js:174:9)
I already setup my android studio and sdk manager, avd manager like it's shown in doc also I already set path but it's still showing that error, anyone know why? Can anyone help please?
You can fix it by using the command :
react-native doctor
This command shows all issues that need to be fixed.
Press f to fix the issues and don't forget to restart your windows
And after then open the emulator before running your project.
Once emulator opened,
run command:
react-native run-android
After fixed:
Don't forget to give me an upvote if that's work.
In My Case, I have to re-run the command in the same terminal where you are trying to run npx react-native run-android
Step 1. paste the source command first
source ~/.bash_profile OR source ~/.bashrc
Step 2. RUN Next command
npx react-native run-android
set your AVD manager path and JDK path like this , also you have to add Android Home path

React Native App on android build says "Unable to load script from assets'index.android.bundle' " requires a system restart

Whenever I run the application on the android phone I get this type of error shown in the image
What I have tried so far is:
regarding packager or metro bundle,I have to shut down my laptop for 10 minutes or some time then the error vanishes, why it is happening? I am using ubuntu as my operating system.
even when it's an error in code and metro bundle error shows up; still the same issue pops up.
I have tried command killing the adb server and restarting the metro too! but nothing good happens.
'yarn start/npm start' etc but it makes nothing for me except another error
on running
yarn start/npm start
i get this error
This error will be no more if I shut down the system & start after sometime & the project works fine! after it until the next error arrives.
It looks you installed some packages through super user privileges, so when you run your project, some files deny Access.
Moreover please check your react and react-native versions and update them to the latest one. To upgrade to latest version run this command
$ npm install -g react-native-git-upgrade then $ react-native-git-upgrade
Or open package.json and change versions of react to "16.6.3" and react-native to "0.57.8".

Meteor server crashes very frequently without any error

I am working with the Meteor application and I deployed the same over EC2 instance. It was working fine till a few days back.
But now the server process kill automatically without any error log or
console
I tried to get the error but unfortunately, as there are not any logs I am unable to find out why the server is crashing again and again.
I have a medium EC2 machine on which the application is running.
I am using nohup for running the application in the background.
Below is the command I used to start the server:-
nohup meteor --settings SETTINGS-PRODUCTION.JSON &
I am wondering to know about server crashes due to nohup or some other reason is there.
Please let me know how we can console uncaught exception in the meteor-like we do in express.
What should I use to auto restart the server if the process is killed
by any error or exception?
Any help would be much appreciated!
Thanks
Using nohup is quite a low-tech solution. Things like Phusion Passenger, PM2, or forever do a better job.
Also your docker container can be configured to automatically restart the process.
Even better is a tool called Meteor Up, which makes it really simple to deploy Meteor apps to EC2.
EASILY DEPLOY YOUR APP Meteor Up is a production quality Meteor app
deployment tool.
Install with one command:
$ npm install --global mup
http://meteor-up.com/

Categories