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.

Can not find sourcemaps while debugging in VSCode

See original GitHub issue

I managed to connect from VSCode to the electron app, using this launch.config:

{ "name": "Debug", "type": "chrome", "request": "launch", "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", "runtimeArgs": [ "${workspaceRoot}/dist", "--enable-logging", "--remote-debugging-port=9222" ], "sourceMaps": true, "webRoot": "${workspaceRoot}/dist" }

But I can’t set any breakpoinst cause sourcemaps are not found. I tried to include this line

"sourceMapPathOverrides": { "webpack:///./*": "${webRoot}/*" }

from the Angular CLI launch.json file, but to no avail. Is there anyone who got this to work ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:8

github_iconTop GitHub Comments

3reactions
adrimarticommented, Nov 5, 2018

Not working now.

2reactions
nikhilnxvverma1commented, May 11, 2019

Spent hours today, finally got the launch debugger working for the main process.

{
			"type": "node",
			"request": "launch",
			"name": "Electron Main",
			"program": "${workspaceFolder}/main.ts",
			"outFiles": [
				"${workspaceRoot}/main.js",
			],
			"cwd": "${workspaceRoot}",
			"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
			"windows": {
				"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
			},
			"args": ["--serve"],
			"runtimeArgs": [
				".",
			],
			"outputCapture": "std",
			"preLaunchTask": "npm: electron:serve-tsc",
		},

Keep in mind my main.ts file outputs main.js in the same top level directory. And more importantly, you need to have the ng serve running ahead of time because this is not running off of the dist folder. Its serving from the devkit server. Hope this helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual studio code Debugger can't find sourcemaps with ...
I am trying to debug my Cordova App that is build using typescript in VisualStudio Code. I have external sourcemaps that are present...
Read more >
TypeScript debugging with Visual Studio Code
TypeScript debugging supports JavaScript source maps. To generate source maps for your TypeScript files, compile with the --sourcemap option or set the ...
Read more >
Debug a JavaScript or TypeScript app - Visual Studio (Windows)
You can debug JavaScript and TypeScript code using Visual Studio. ... For help with generating source maps, see Generate source maps for ...
Read more >
Debugging - vscode-docs
Whenever you set a breakpoint in the original source, VS Code tries to find the generated source, and the associated source map, in...
Read more >
Vscode Debugger Cannot Find Source Maps Unless It Is In Absolute ...
I have generated the js.map files by running the tsc sourcemap app.ts command. After all of those steps when I set a breakpoint...
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