-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
v8 debugger source url mismatch with workspaces in windows #10672
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
Comments
Please report this against Chrome DevTools at
https://bugs.chromium.org/p/chromium/issues/list
…On Fri, Jan 6, 2017 at 4:37 PM László Szirmai ***@***.***> wrote:
I want to use chrome as a node js debugger/"ide". node --inspect works
fine but when i want to map files with the local file system in windows for
live editing... i got problems with the workspace path mappings /
breakpoints, etc. Im using NodeJS v7.4
I made a proxy workaround to remap the source urls and replace the
directory separators.
My process runs form a subdirectory... thats why i made this:
path.resolve(__dirname+'/../..');
This code connects to the standard 5858 debugger ws port and listens on
5859... so you have to change the link when connecting devtools. Example:
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=
127.0.0.1:5859/11212484-27c8-4a50-98c0-e298d8b9942c
If there is a better solution, pls tell me.
this works fine from a seperate process::
var WebSocket = require('ws');
var WebSocketServer = WebSocket.Server;
var path = require('path');
wss = new WebSocketServer({ port: 5859 });
wss.on('connection', function connection(ws) {
ws.dbgclient = new WebSocket('ws://localhost:5858' + ws.upgradeReq.url);
console.log('Debug proxy connection: ' + ws.upgradeReq.url);
ws.dbgclient.on('message', function(message) {
//From app
var msg = JSON.parse(message);;
if (msg.method=='Debugger.scriptParsed') {
var abspath=path.resolve(__dirname+'/../..');
if (msg.params.url.indexOf(abspath)==0) {
msg.params.url=msg.params.url.substring(abspath.length).replace(/\/g, '/');
}
}
ws.send(JSON.stringify(msg));
});
ws.dbgclient.on('close', function() {
console.log('Host connection closed');
});
ws.on('message', function(message) {
//From chrome
var msg = JSON.parse(message);
if (msg.method=='Debugger.setBreakpointByUrl') {
msg.params.url=(path.resolve(__dirname+'/../../')+msg.params.url).replace(///g,
'\')
}
ws.dbgclient.send(JSON.stringify(msg));
});
ws.on('close', function() {
ws.dbgclient.close();
console.log('Proxy connection closed')
})
});
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10672>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARkrUExYldSkw_a1NZdSUARGj6-zfulks5rPt4-gaJpZM4LdQsS>
.
|
I made a faster proxy at #11164 |
This issue has been inactive for sufficiently long that it seems like perhaps it should be closed. Feel free to re-open (or leave a comment requesting that it be re-opened) if you disagree. I'm just tidying up and not acting on a super-strong opinion or anything like that. |
The problem still exists.... nodejs in windows use backslash as dirseg... and chrome can't map with local workspace. I override the path with //@ sourceURL=/path/to/file in every file now. |
I'll close this out as a duplicate of #10838. It's newer than this issue but has more info and discussion. |
Uh oh!
There was an error while loading. Please reload this page.
I want to use chrome as a node js debugger/"ide". node --inspect works fine but when i want to map files with the local file system in windows for live editing... i got problems with the workspace path mappings / breakpoints, etc. Im using NodeJS v7.4
I made a proxy workaround to remap the source urls and replace the directory separators.
My process runs form a subdirectory... thats why i made this: path.resolve(__dirname+'/../..');
This code connects to the standard 5858 debugger ws port and listens on 5859... so you have to change the link when connecting devtools. Example: chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5859/11212484-27c8-4a50-98c0-e298d8b9942c
If there is a better solution, pls tell me.
this works fine from a seperate process::
The text was updated successfully, but these errors were encountered: