electron-vite / electron-vite-react

:electron: Electron + Vite + React + Sass boilerplate.
https://electron-vite.github.io
MIT License
1.85k stars 218 forks source link

debugging is not working in VSCode #64

Open lifeiscontent opened 2 years ago

lifeiscontent commented 2 years ago

I tried setting the same breakpoints outlined in the preview of the readme and they don't seem to be working.

this is my version info for VSCode:

Version: 1.71.0
Commit: 784b0177c56c607789f9638da7b6bf3230d47a8c
Date: 2022-09-01T07:25:10.472Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.14.0-1050-oem snap
Sandboxed: No

I'm also running Ubuntu 20.04 LTS

caoxiemeihao commented 2 years ago

Can you provide a minimal reproduction Demo?

lifeiscontent commented 2 years ago

@caoxiemeihao the template itself is a reproduction

electron-vite-react-debug.gif

this doesn't work on Linux.

caoxiemeihao commented 2 years ago

Ubuntu? I may need a Linux system 😅

lifeiscontent commented 2 years ago

@caoxiemeihao I'm using a variant of ubuntu, so that should yield similar results. :)

HZSamir commented 1 year ago

Same issue as @lifeiscontent , on Windows 10, Node 18. Breakpoints don't trigger.

SnekCode commented 10 months ago

Debug is also not working for me. Windows 11 Node v20.1.0. Task starts then hangs.

RSS1102 commented 10 months ago

启动 我是Windows11,node18.16.0是可以调试前端页面的...

Stanzilla commented 7 months ago

Doesn't work for me either, can't access the URL:

❯  cd /home/stan/projects/personal/wago-app ; /usr/bin/env VITE_DEV_SERVER_URL=http://localhost:5174/ 'NODE_OPTIONS= --require /home/stan/.vscode-server/bin/903b1e9d8990623e3d7da1df3d33db3e42d80eda/extensions/ms-vscode.js-debug/src/bootloader.js ' 'VSCODE_INSPECTOR_OPTIONS=:::{"inspectorIpc":"/tmp/node-cdp.124098-8884dbf6-23.sock","deferredMode":false,"waitForDebugger":"","execPath":"/usr/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","mandatePortTracking":true,"fileCallback":"/tmp/node-debug-callback-d04af5c6d02f0815"}' /home/stan/projects/personal/wago-app/node_modules/.bin/electron --no-sandbox --remote-debugging-port=9229 . 
Debugger listening on ws://127.0.0.1:53907/901b01f4-38dc-4776-a40e-82d34dc16d8a
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger listening on ws://127.0.0.1:53481/fb560429-0bcb-444c-9a90-ffa31d3b7455
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

DevTools listening on ws://127.0.0.1:9229/devtools/browser/bfd8ee3c-8db7-42a3-b00f-97674f3be1ea
[132812:0227/000913.519427:ERROR:connection.cc(575)] Cannot send request of length 31158756
(node:132812) ExtensionLoadWarning: Warnings loading extension at /home/stan/.config/wago-app/extensions/lmhkpmbekcpmknklioeibfkpmmfibljd:
  Manifest version 2 is deprecated, and support will be removed in 2023. See https://developer.chrome.com/blog/mv2-transition/ for more details.
  Permission 'notifications' is unknown or URL pattern is malformed.
  Permission 'contextMenus' is unknown or URL pattern is malformed.

(Use `electron --trace-warnings ...` to show where the warning was created)
Added extension: Redux DevTools { class: 'main' }
Added extension: React Developer Tools { class: 'main' }
(node:132812) electron: Failed to load URL: http://localhost:5174/ with error: ERR_CONNECTION_REFUSED
[132812:0227/000914.263168:ERROR:CONSOLE(1)] "Request Network.loadNetworkResource failed. {"code":-32602,"message":"Unsupported URL scheme"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)
^C/home/stan/projects/personal/wago-app/node_modules/electron/dist/electron exited with signal SIGINT
Waiting for the debugger to disconnect...
e-gehlen commented 3 months ago

On windows I got this to work by adding the following line to my Debug Main Process section:

"attachSimplePort": 0