-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to map a large amount of bytes #65
Comments
Can you share your file? Are you using an inline source map? |
Unfortunately, cannot share my file. I am using an inline source map. I'll check tomorrow, I might be able to anonymize my source file. So I can give you something similar to it |
I get similar behavior. I see here's my file, zipped up: lighthouse-background.js.zip |
@mdvorscak @paulirish would you be happier seeing that |
I'd rather keep it in with |
@mdvorscak I believe it is an issue with the source maps that I'm a little surprised that it's a majority of bytes in your source map, though. The unmapped bytes are usually just whitespace and return statements. |
I like labelling unmapped stuff as btw the map i provided is from browserify, no tsc involved. |
I've got a fix that counts inline source maps separately. Here's what the command line looks like:
and the visualization: @paulirish @mdvorscak what do you guys think? Is this more confusing than just omitting the bytes from the inline source map by default? |
I like this approach since it leaves the possibility to use the option |
My only concern is that when you use SME, it's usually because you want to shrink your JS bundle. In which case the inline source map is a large (in terms of # of bytes) distraction. If those bytes were excluded from the visualization, it would blur the distinction between running with separate |
with browserify it's a slight pain to extract the inline sourcemap to a separate file, so i prefer not to do it. The only reason i sometimes build with sourcemaps is to use SME. I think having the correct filesize up top makes the tool more trustworthy, so I think it's worthwhile to tell the truth even if it makes exploring the data slightly more annoying. I guess it'd be slightly better if there was a treemap box around the non-inline-sourcemap stuff so i can very quickly exclude that from view. (In this file, there are two siblings rather than just one). Is it reasonable for there to be a |
FYI: In our case this was due to comments left by webpack and untouched by uglify, mostly ModuleConcatenationPlugin bailout messages. We solved by turning off |
Hi @danvk Just want to understand what part of code is unmapped code and Are you planning to add better visualisation for a developer to understand it. |
There should be simple utility that can output bundle lines that are not covered by sourcemap. As a first step to understand "why there are unmapped lines?" |
@mdvorscak @paulirish I just realised that in my case the majority of the unmapped bits were related to |
having the similar issue when analyzing bundle build by
|
@littlee Running into the same problems over here, 2.1 MB, 64% of the total bundle is unmapped. Reproduction steps:
|
Fixed my problem, in my case the unmapped bytes were caused by a package being imported. |
@littlee , same here. What version of react-scripts are you using? Are you using Typescript? |
I am using the latest version of
|
Thanks @littlee, |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Please stop posting |
Still seeing this with the latest
Result:
|
Still experiencing this issue with |
build/static/js/main.99550a42.js reproduce it with CRA 4.0.1 |
reproduce it with CRA 4.0.2 build/static/js/2.c35a0e8e.chunk.js
Unable to map 175/1951255 bytes (0.01%)
build/static/js/main.2755ea06.chunk.js
Unable to map 253/67052 bytes (0.38%)
build/static/js/runtime-main.17e26823.js
Unable to map 13/1561 bytes (0.83%)
Done in 1.70s. rw-r--r-- 1 rioshi rioshi 1 MiB Thu Feb 25 17:37:19 2021 2.c35a0e8e.chunk.js
rw-r--r-- 1 rioshi rioshi 1 KiB Thu Feb 25 17:37:19 2021 2.c35a0e8e.chunk.js.LICENSE.txt
rw-r--r-- 1 rioshi rioshi 9 MiB Thu Feb 25 17:37:19 2021 2.c35a0e8e.chunk.js.map
rw-r--r-- 1 rioshi rioshi 65 KiB Thu Feb 25 17:37:18 2021 main.2755ea06.chunk.js
rw-r--r-- 1 rioshi rioshi 118 B Thu Feb 25 17:37:19 2021 main.2755ea06.chunk.js.LICENSE.txt
rw-r--r-- 1 rioshi rioshi 155 KiB Thu Feb 25 17:37:19 2021 main.2755ea06.chunk.js.map
rw-r--r-- 1 rioshi rioshi 1 KiB Thu Feb 25 17:37:19 2021 runtime-main.17e26823.js
rw-r--r-- 1 rioshi rioshi 8 KiB Thu Feb 25 17:37:19 2021 runtime-main.17e26823.js.map |
same thing here. npx source-map-explorer build/**/*.js
build/static/js/2.ea5231d0.chunk.js
Unable to map 183/1009903 bytes (0.02%)
build/static/js/main.76a6cd7f.chunk.js
Unable to map 101/53915 bytes (0.19%)
build/static/js/runtime-main.4f382c48.js
Unable to map 13/1569 bytes (0.83%) i dont even get a
|
Facing the same issue. |
In a (non-React) app with parts of it being built with webpack, in a development build (everything fine in prod!) I was seeing similar cases of whole chunks being mostly a large unmapped block, even though full source maps ( |
this did the trick for me. With production mode on, the html shows correct information. Thanks @simonihmig |
When running this tool I get: Unable to map 4270596 / 6575223 bytes (64.95%) printed to the console. The report still generates, but most of my bundle is 'unmapped'. This seems related to #47 , since this corresponds to TypeScript code. However, I get no information about any TypeScript code at all. Is this normal?
The text was updated successfully, but these errors were encountered: