Closed gerdneuman closed 5 years ago
There are two index.js files because the sourcemapped URL is the same as the ugly file. We have an enhancement for that coming with https://github.com/devtools-html/debugger.html/pull/6548
I am seeing different behavior on my machine:
My STR: 1) Go to vanilla React App: https://new.codesandbox.io/ 2) Set a breakpoint on line 9 of index.ts (I don't see index.js) 3) Reload the page 4) The debugger breaks in process.ts, line 38
Note that both index.ts and process.ts are source mapped from browserfs.min.js Bug in source mapping?
Honza
It looks like we:
It looks like the example site has changed since this was filed, so it doesn't reproduce anymore. The generated code is formatted differently.
@loganfsmyth Source code slightly changed, but are mainly the same:
But the AR are different now but still not what I would expect:
Debugger does not stop at line 8 of mapped source file now, but stops on the unmapped index.js file:
My ER would be to have the Debugger stop at the mapped index.js where I set the breakpoint.
Alright perfect.
The issue here appears to be caused by the fact that the url of the mapped file is the same as the URL of the generated file, which means that when the page reloads and hits https://github.com/devtools-html/debugger.html/blob/9309042df4ecd99c8859b190d8fc8287e18851ad/src/actions/sources/newSources.js#L113, the generated file loads first and causes the selection to change to the generated file before the original file has loaded.
I'm thinking that this check should be using (This won't work)sourceId
instead of url
, but I'd have to dig in more to see if there are issues with changing to that approach.
Is this fixed? I can't reproduce the new case described here: https://github.com/devtools-html/debugger.html/issues/6685#issuecomment-432301947
For me the page breaks correctly in (mapped) file.
Honza
It works well for me too
I use current Nightly version on Windows 10
Steps to Reproduce:
index.js
:What happens: Now there is also a breakpoint on line 8 which I never set:
Expected: This breakpoint on line 8 should not be added.
Maybe related: Why are there 2
index.js
files on the leftSources
panel? See above screenshot. Or is this another bug?