Closed Bug 1434081 Opened 8 years ago Closed 7 years ago

webpack-generated source maps have incorrect line numbers when page is force-reloaded

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wlach, Unassigned)

References

(Blocks 1 open bug)

Details

Here's a strange bug I've found with using source maps with a webpack application: git clone https://github.com/wlach/react-metrics-graphics.git cd react-metrics-graphics git checkout source-map-failure yarn install yarn start Go to http://localhost:5000 Force-reload page Expected: Should see a console.log statement saying "HEYA" referencing line 158 Actual: see a console.log statement saying "HEYA" referencing line 77 If I load the page in a new tab with the web console open, most often it references the correct line number (force-reloading usually results in it having the wrong one again though). This feels like some kind of race condition. If I go into the debugger, it seems like it's referencing the webpack-internal version of the source map for the incorrect case.
Blocks: source-maps
I should add that this "just works" with Chrome.
This seems similar to bug 1400856, but I tried the proposed fix there (https://bugzilla.mozilla.org/show_bug.cgi?id=1400856#c3) and it did not help.
It seems like in the case that this works, the debugger is pointing to something called "webpack:///", whereas if it isn't, it's pointing to something called "webpack-internal:///".
(In reply to William Lachance (:wlach) (use needinfo!) from comment #2) > This seems similar to bug 1400856, but I tried the proposed fix there > (https://bugzilla.mozilla.org/show_bug.cgi?id=1400856#c3) and it did not > help. That would be my first guess, too. Source maps in <script> elements don't really work correctly. There are a few bugs about this. I don't think that patch in bug 1400856 is correct - I will comment there.
I'
Priority: -- → P2
I'd like to fix inline script source maps in the next couple of months.
Product: Firefox → DevTools

Hi William, i believe we've made improvements to inline source maps. Could you try re-testing this?

(In reply to Jason Laster [:jlast] from comment #7)

Hi William, i believe we've made improvements to inline source maps. Could you try re-testing this?

Yeah I've noticed this seems to be working well in general these days, happy to mark this as fixed.

Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED

Great!

You need to log in before you can comment on or make changes to this bug.