1

How could I set a breakpoint when I cant locate the file/line that I want to locate in developer mode

Here is the developer tool mode when I click F12 in chrome.

However, the project list shown is weird now. But I certainly know the file I want to set the break point/ or line(keyword). Is it possible to locate the breakpoint in such scenario

Update: hence the files are not maintained by me. So, I couldnt add a breakpoint(debugger) directly on the files. But I could only a developer mode via there. I just want to check values on that line.

enter image description here

Ae Leung
  • 300
  • 1
  • 12
  • https://stackoverflow.com/a/25551397/7867822 – Anurag Srivastava Feb 27 '23 at 07:00
  • Seems like you have no `.map` files but only the final bundles. – derpirscher Feb 27 '23 at 07:48
  • May I know what does it mean? This is actually on production – Ae Leung Feb 27 '23 at 07:49
  • But is it still posiible to find that file? or even just that line.... I know the keyword – Ae Leung Feb 27 '23 at 07:49
  • Probably not, because those bundles are minimized. That's what the `.map` file would be for. They create a translation/relationship between the original source files and the minimized production files. – derpirscher Feb 27 '23 at 07:51
  • Can I still locate the line in minimized files? – Ae Leung Feb 27 '23 at 08:40
  • I have seen ppl can still locate the keywords by searching in the past... but dont know how to search in such scenior..... – Ae Leung Feb 27 '23 at 08:41
  • you can try searching for your keyword in the files. But without a map file, debugging will be hard to impossible ... And if your keyword is just some identifier, it might even been removed by minimization ... – derpirscher Feb 27 '23 at 09:18
  • Actually I have the variable name. but its just I want to debug on production – Ae Leung Feb 27 '23 at 09:43
  • A "variable name" is an identifier. And depending on the settings at build, it probably has been refactored to something else during minimization, so chances not too good, you'll find it. – derpirscher Feb 27 '23 at 10:21
  • May I ask, you mentioned .map, where can I find that .map? is it some configration i somewhere? I would like to see if I can see where the .map is and then try to understand the underlying – Ae Leung Feb 27 '23 at 10:28
  • 1
    `.map` files are created during build. So -- as you said you don't maintain those files -- you would have to ask the people who are in charge of building and deploying this app for them ... – derpirscher Feb 27 '23 at 10:55
  • I see. Honestly, I have those files in my local. But I dont have premission to deploy to local, and I could only run it on my local. But the behavior i saw in my local is different than the one in production. which is why I want to debug the code in production. That's where I showed you the minized files. But I have never built before. May I know where I can see the build configuration in my project? (if you maybe somehow know) – Ae Leung Feb 27 '23 at 13:57

1 Answers1

0

Add debugger; statement where u want to break.

Anil Maharjan
  • 441
  • 4
  • 14
  • hence the files are not maintained by me. So, I couldnt add a breakpoint there. But I could only a developer mode via there – Ae Leung Feb 27 '23 at 07:44