question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[docs] how can i debug the frontend project in vs code with breakpoint instead of using the devtools

See original GitHub issue

i have set devPath to https://localhost:8080/ which is served by the webpack-dev-server, the question is how can i connect to the tauri webview in vs code so i can debug directly in vs code with breakpoint supported instead of using the devtools to debug?

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
amrbashircommented, Sep 1, 2022

if you want to debug your regular web app without Tauri, you can still do that. Unfortunately with tauri, this is not possible since I couldn’t find a way to attach a remote debugger from VSCode to Linux’s Webkit2gtk or macOS’s WkWebview. Only Webview2 allows this.

For webview2, the debugging steps are easy:

  • add this to .vscode/launch.json
    {
    	"type": "msedge",
    	"request": "attach",
    	"name": "Attach to tauri webview",
    	"port": 15567,
    	"webRoot": "${workspaceFolder}",
    	"sourceMaps": true
    }
    
  • open a powershell instance and run: $env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS="--remote-debugging-port=1422"; npm run tauri dev and wait for tauri webview to launch
  • press F5 in VSCode
0reactions
liesauercommented, Sep 1, 2022

no, https://github.com/tauri-apps/tauri-invoke-http is not expected solution. no additional plugins or depencies, just one or two configuration, press F5, boom, you are good to go. this is exactly what i need to do when i debug a regular web project in vs code now. this should be the expected debugging experience when we are developing a web project no matter it is a regular web app or hybrid web app.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debug Browser Apps using Visual Studio Code
Set breakpoints, step-in, inspect variables and more. ... The simplest way to debug a webpage is through the Debug: Open Link command found...
Read more >
Debugging in Visual Studio Code
To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and...
Read more >
Debug Node.js Apps using Visual Studio Code
The Visual Studio Code editor includes Node.js debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >
Introducing Chrome Debugging for VS Code
To get started, open the Extensions view (Ctrl+Shift+X). When the extension list appears, type 'chrome' to filter the list and install the ...
Read more >
TypeScript debugging with Visual Studio Code
In the Run and Debug view (Ctrl+Shift+D), select create a launch. json file to create a launch. json file selecting Web App (Edge)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found