-
Notifications
You must be signed in to change notification settings - Fork 6.3k
-
Hi everyone!
I have two questions concerning to debugging with code server:
-
Is it possible to debug React Application on it?
I'm trying to debug a react application but an error is shown saying that I need to open on VS Code desktop in order to enable debugging. Are there any steps that I'm missing so I can debug from code-server?
image -
I've started a code server locally with 'yarn watch' command. But when I try do debug a nodejs application, node debugger options are not shown, even though the extension for node debugger is installed. When I run the code server provided by the image (https://hub.docker.com/r/codercom/code-server) the node option is normally shown. Is there any thing I can do to debug node applications running code-server locally?
image
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 5 replies
-
I'm a simple man, I use console.log
s for debugging.
-
I'm not totally sure on that 🤔 I have never tried to use the debugger with a React application and code-server. If you provide repro steps for both code-server and VSCode, I'm happy to try locally.
-
Unsure about the wording here. Do you have an application which has a
yarn watch
script or are you running code-server locally (like contributing to it) and running theyarn watch
command to start it up? Again, I haven't tried debugging node applications running locally, but happy to give it a try with some repro steps.
Jokes aside, hoping we can help you figure this out.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for the quick answer @jsjoeio! Below the details you asked for.
- The way I debug in VSCode is as detailed in https://code.visualstudio.com/docs/nodejs/reactjs-tutorial . I just set a break point and create the launch.json file, using options provided by the VSCode.
- What I was trying to describe is the second scenario you wrote: "running code-server locally (like contributing to it) and running the
yarn watch
command to start it up". In this scenario, again, debugging follows the same: create a launch.json file with VSCode wizard and just run debug. The strange fact is that when I start it up locally it doesn't show me the Node.js option!
image
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 1
-
Welp. I have good news and bad news. The good news is I was able to reproduce this:
Video
The bad news is I'm not sure how to fix this off the top of my head 🤔
I found this article which might be helpful, but maybe not.
The other thing would be to try replicating this in Codespaces (if you have access). If it happens there, it's an upstream issue. If not, it's a code-server issue
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Oh and for 2. that's strange. Again I don't use it locally when working on code-server so I don't think I can help much there. Workaround would be to debug using console.logs unfortunately.
Let me know your thoughts though after looking more into 1. Happy to keep bouncing ideas off each other here!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Thanks again @jsjoeio !
Well, for 2 I tried an update on nodejs version (since mine was different from that one on the docker image) but it still does not recognize node as a debugger type.
I'm also trying to get access to codespaces so I can try the suggested test for 1. I'll write if I get any news.
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
No prob! Sorry it wasn't better news. Ah bummer. Not sure why that would be 🤔
Sounds good! Keep us posted.
Beta Was this translation helpful? Give feedback.