New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong debugging configuration #2757
Comments
Using the provided solution, I still get errors from Electron: Main telling that electron.app is not defined. I don't get why the specified action in launch.json behaves different than calling yarn start:main from my cmd. In the end, if I put conditional access to app -> app?.on I ultimately get the error message "Cannot connect to runtime process, timeout after 15000 ms. (ECONNREFUSED 127.0.0.1:9223)
|
I just found out that changing the |
"I just lost 5 hours of my life on this. I want it back." Haha, thanks for the simple fix.
Update: Well breakpoints work now but two instances of electron always launch. Using the Electron Main task. First window opens quickly, second window pops open about 10s later. Had to do both of these. Now Electron Main, Renderer, All tasks work as expected.
|
@halsafar If you don't delete the |
Hi, I was wondering why this has been closed with no solution I'm on Windows and I was not able to make debug work for until I put this. "runtimeArgs": ["start:main", "--inspect=5858", "--remote-debugging-port=9223"], Maybe this is not affecting those who are on Mac? |
@guillemsola It affects Linux (Ubuntu 20.04) users, so I guess it affects Mac users too. I was surprised too when I found out that the issue was closed without solution. I'm glad my fix worked for you! |
Thank you, new electron user here and this has solved my issue on Macbook Pro with Big Sur. |
As this seems to be the default thread to discuss debugging, allow me to add my own two-cent. To explain: the start:renderer task no longer outputs |
Is there anybody to post his webpack config for launching basic Electron app pls ? |
I am still getting the same error even after June 2022 commit fix. Anyone else facing the problem? Might have to open another issue for this. |
+1 |
What was going on for me was that the renderer debugger was trying to attach before the main process was completely up. When I start the main process and wait until it is completely up and then start the renderer it works. Ideally you'd try to attach the renderer after the main process comes completely up, but increasing the timeout value in the renderer configuration in the launch.json seems to work around the issue. I imagine that the there may be some consequence of making it arbitrarily large, but using a value of 100000 and 1000000 (I'm assuming that is in milliseconds meaning that would be 100 and 1000 seconds respectively) seems to not affect anything, other than making the remote debugger work. |
@tscheney 's comment work for me thanks! |
Prerequisites
master
branchDEBUG_PROD=true yarn build && yarn start
Expected Behavior
The "Electron: All" launch configuration for VS Code should:
--inspect=5858
and--remote-debugging-port=9223
.Current Behavior
The "Start Webpack Dev" task in
.vscode/tasks.json
is spawning electron itself, whereas the "Electron: Main" launch configuration in.vscode/launch.json
is failing."Electron: Main" is failing because the yarn args should be:
instead of:
When using
"start:main --inspect=5858 --remote-debugging-port=9223"
, yarn fails because it cannot find a the command "start:main --inspect=5858 --remote-debugging-port=9223" (it is trying to use the whole string as the command name).Since the "Electron: Main" configuration fails, no electron window should be visible, however an electron window does show up. This is because the following code at
.erb/configs/webpack.config.renderer.dev.babel.js
:Issues #2730 and #2714 may be related.
Steps to Reproduce
Launch "Electron: All" configuration
Look at the debug console, you will see that the yarn process has finished with an error.
If you try to place breakpoints on the renderer side, they won't fire.
Possible Solution (Not obligatory)
Context
I was trying to debug an app and breakpoints were not firing. That's when I went to the debug console and saw that the "Electron: Main" configuration was failing.
Your Environment
The text was updated successfully, but these errors were encountered: