Home > Software design >  Chrome dev tool show file name and line number instead of main.js
Chrome dev tool show file name and line number instead of main.js

Time:11-10

when I console log something,

I was pretty sure I got file name and line number before.

but now I can only see main.js and a number like this:

enter image description here

Does anyone know how to change it back? Thanks.

CodePudding user response:

If you wish to see a stacktrace with your logs, use console.error() or console.warn() instead of console.log().

If you don't like the red or yellow color, you can use console.log(new Error().stack) instead.

CodePudding user response:

I geuss you are looking for sourcemaps: https://developer.chrome.com/docs/devtools/javascript/source-maps/ .

  • Related