I am a newbie in React Native and I am trying to set up the environment for it in VScode using Expo Cli. Even though I follow all the steps in Youtube, I still can't make it. I have installed Node.js and extension of React Native. I have opened the port for the Metro Bundler and Web but I don't know why I can't open them.
Here are pictures of my screen. This is my first post, so I'm not allowed to post pictures but links. Sorry for the inconvenience.
1st
2nd
I have no clue how to fix it so I try to search for the problem, but nothing has improved.
Windows 10 Pro x64
VS Code
Node 15.10.0
My default browser, for day-to-day work is Chrome, but when developing websites I've started using Firefox Developer. Is there a way to specify which browser I want Gatsby to open while I'm testing the site on my local machine?
Thanks everyone.
Is there a way to specify which browser I want Gatsby to open while
I'm testing the site on my local machine?
No, you can't.
According to gatsby-cli options, the -o or --open flags opens the default browser at localhost:8000 but you can't choose the browser, it will take the default system browser since it's a bash command, outside of Gatsby's scope.
You can make a PR to Gatsby's repository if you want with your proposal or you can dive into customizing the bash prompt, maybe this SuperUser answer enlights you: https://superuser.com/questions/350309/how-can-i-open-a-url-in-google-chrome-from-the-terminal-in-os-x
There have been a couple of older posts regarding this issue, but date from questions asked in 2013 and 2014 and the answers in there have not helped my case.
I have the debugger keyword placed in multiple places in my file, and have even added manual breakpoints in the inspector UI. Still, executing the file does not stop at any breakpoints. I am using node 9.2.0 and chrome 64.0.3282.167.
Here is a picture of how my devtools appears.
Use the --inspect-brk flag instead
I ended up opening up an issue on the devtools protocol github page.
I got an immediate answer. Basically, because I was using the --inspect flag to start the Node.js debugger, my JavaScript was being executed before the debugger process was connecting to the DevTools server. Therefore breakpoint information would be relayed too late and no breakpoints would be triggered.
Example: node --inspect-brk myscript.js
They're currently trying to improve this use case. Here's the actual reply:
We are working on better workflow here but for now --inspect-brk is
only one way. With --inspect-brk node waits DevTools frontend
connection. On connection DevTools send all breakpoints information
and starts JavaScript execution in node. With --inspect node starts
JavaScript execution without waiting for DevTools frontend. As soon as
DevTools connected, we send the same breakpoint information to node
but it can be too late since some JavaScript is already executed.
The Node.js docs are not very clear on this subtlety as of 4/6/2018. I will submit a PR on their repo to update the docs. BTW, if you are not aware, even without the V8 integration, the built-in debugger is very powerful. Explore all the possibilities of the debugging utility in the docs.
This is a problem that has been extremely annoying to me since 10.13 went to LTS and I upgraded from 8 to 10.
I was unable to find anything about this issue until I saw this question here on stack overflow, that was the catalyst I needed to be able find more about the problem and discover the cause and the solution.
You can find out more here: https://github.com/nodejs/node/issues/23693
The Why:
Basically it is because of a change to the debugger protocol in Node.
The Solution:
Upgrade Chrome to 71 or later which supports the change in the protocol.
Much Better Solution: Install NIM: https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj then go to the NIM settings and change the selected DevTools version to the one from chrome-devtools-frontend.appspot.com ( see more about this option here: https://june07.com/blog/nim-custom-devtools-url/ )
I have this issue too: Chrome Devtools Inspector not stopping at breakpoints.
My problematic software versions:
Chrome: Version 70.0.3538.77 (Official Build) (64-bit)
Node: v10.12.0
A workaround I found is to downgrade NodeJS to version 8.12.0 (the latest 8.x version). Node version 8.x works for me.
$ node -v
v8.12.0
I also tried Node version 10.13.0, 11.1.0, none of them works for me.
FYI: How to change Node version
The deeper reason seems to be that the debugger maintains two separate databases where it stores the breakpoints. Opening a file from the Sources tab, and setting breakpoints in it, is a waste of time. Maybe node considers these suspicious or unconfirmed -- whatever. They are ignored. These breakpoints are stored "somewhere" but not in the place that an active debugging session finds them or respects them.
You need to first manage to break the active execution of the source file that you want to debug, and then set the breakpoints while in a running context. You will notice that all breakpoints that you had previously set via the Sources tab have disappeared, and you can set new breakpoints. Only those new breakpoints are "observed" by node at runtime.
So the workaround today (September 2019) is as follows:
Pepper the source file you wish to debug with debugger; statements
Start your project with inspect-brk to force the debugger to stop the program before its first line is executed
Click the little blue arrow to continue execution normally; the debugger; statements should now break in the source file you are interested in.
Once you are stopped, you can set breakpoints that will actually be observed, and saved, in the "correct database" (for the lack of a better term).
I had the same issue today while working with 10.13.0. based on the comment from answer 4, I tested different versions with $ nodenv local <version> and I had the following results:
10.13.0 (not working)
10.12.0 (not working)
10.11.0 (working)
10.10.0 (working)
Assuming lower versions work.
If you're not familiar with nodenv, you can get it here https://github.com/nodenv/nodenv
I found that if I manually type:
debugger;
where I want the breakpoint to occur in my code then this actually fixes this issue for me.
e.g.
var counter=0;
while (true) {
for (i = 0; i < 5; i++) {
debugger; //enter this through Chrome Dev then press CTRL s to save
counter++;
}
}
I'm running the above via:
node --inspect-brk=0.0.0.0:5000 test_debugger.js
[The 0.0.0.0 is here due to this being on a remote server.]
I had a similar problem and found an easy fix. Instead of using chrome devtools, try node-inspector, which does the same thing - https://github.com/node-inspector/node-inspector#quick-start
Open node.js command prompt
Install the node-inspector package npm install -g node-inspector
node-debug <your-entry-point> replace <your-entry-point> with your 'main' file, usually app.js by default (remember to navigate to the full file location if not already there e.g. C:\Users..)
Wait for new browser window with node-inspector to open
How can you quit browser-sync from running in the terminal without quitting the terminal application itself?
I am new to using terminal-based frameworks and technologies so this is probably very basic, but I haven't found such command in the guides from their website. What I am trying to do is exiting browser-sync session and keep on using the terminal.
Just Press ctrl + c You will asked to press Y / N And if you press Y then the browser sync will stop along with other command line tools.
I am also relatively new command-line and sorts, but I do believe that any local server can be terminated via "ctrl+c". While I am not sure about the general rule, I do know that ctrl+c works to exit browser sync in the terminal.
I assume you are using this guide to install browser-sync? https://www.browsersync.io/#install
People typically use browser-sync in conjunction with local client-server web development (like editing html and css, etc.), so you typically do not run browser-sync by itself.
Follow this video to get a better idea on how to integrate browser-sync into your workflow for web development: https://www.youtube.com/watch?v=heNWfzc7ufQ
That video shows how to start from a basic html file and use browser-sync to constantly watch for changes.
I'm pretty new to grunt, and created a new app using generator-angular-fullstack and yeoman. I'm trying to figure out how to debug.
When I run grunt serve:debug, I get a Chrome window with http://localhost:8080/debug?port=5858
I then open my application at http://localhost:9000 in another Chrome tab.
Two issues though:
If I set a break point, the debugger never hits it
I can only set breakpoints in client side js, not server side
Thanks for any help