DevTools JavaScript debugger incorrectly thinks a file is not minified and so won't pretty-print it
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
People
(Reporter: mozilla, Unassigned)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0
Steps to reproduce:
- visit https://app.regrello.com
- open dev tools
- navigate to the debugger
- select the following file:
/static/node_modules/.pnpm/react-dom@17.0.2_react@17.0.2/node_modules/react-dom/cjs/react-dom.production.min.js - click the "{}" pretty-print button under the minified source code
Actual results:
The button cannot be clicked. It is disabled, and on hover, displays the following message:
"Can't pretty-print original sources, file is already readable"
Expected results:
The button should have worked and reformatted the source code.
Note: the file can still be pretty-printed by right-clicking the tab above the debugger with the filename, and then selecting "pretty-print source"
| Reporter | ||
Comment 1•3 years ago
|
||
Comment 2•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Debugger' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•3 years ago
|
||
The message is indeed confusing. If I remember correctly the reason we disable the button is that this source is an "original" source, meaning that we retrieved it from a sourcemap. In this case the website actually uses it packaged in a bundled file called https://app.regrello.com/static/js/3.a16de4ac.chunk.js. Pretty printing an original source can confuse the debugger and create issues with breakpoints.
We should not assume that the file is "readable" and at least update the message.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 4•3 years ago
|
||
It was incorrectly assumed that original sources are always prettyfied.
In these cases we should enable pretty printing.
Updated•1 year ago
|
Comment 5•11 months ago
|
||
If we want to support pretty-printing original files (coming from a sourcemap) then we'd probably need to merge the sourcemap that contains the original file with the one we generate for the pretty-printing step. There are several libraries that show how to do this: merge-source-map, combine-source-map (both based on our source-map library) and @ampproject/remapping.
Updated•5 months ago
|
Description
•