Skip to content

Injected code clobbers line numbers in console object calls #449

@DervishD

Description

@DervishD

A simple example: in file index.js, line 10, we have:

console.log('hi there');

When running that code, the expected output in DevTools console would be something like this:

http://127.0.0.1:8080/index.js: hi there    index.js:10

But we get this instead:

http://127.0.0.1:8080/index.js: hi there    ___vscode_livepreview_injected_script:139

This is due to the fact that the injected code is redefining console calls using createConsoleOverride which is losing the context.

Since createConsoleOverride returns a function that does some processing before calling the corresponding console object method, I don't know how to bind this properly there.

This is not the end of the world, of course, but it makes a bit cumbersome to use tracing messages because clicking on the location of the message will get us to the injected code and not to the proper place when the console object method really happened.

Thanks!

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions