IjzerenHein / react-native-bundle-visualizer

See what packages are increasing your react-native bundle size 📦
MIT License
1.43k stars 42 forks source link

Unable to map error #41

Open deathemperor opened 3 years ago

deathemperor commented 3 years ago

I was able to run a couple weeks ago but failed continuously today without any error.

yarn run v1.22.4
$ /Users/xxx/xxx/xxx-expense/node_modules/.bin/react-native-bundle-visualizer --expo managed
Generating bundle...
                 Welcome to React Native!
                Learn once, write anywhere

info Writing bundle output to:, /var/folders/y8/7lh919_s0j38nkv2btgd7dy00000gp/T/react-native-bundle-visualizer/UnknownApp/ios.bundle
info Writing sourcemap output to:, /var/folders/y8/7lh919_s0j38nkv2btgd7dy00000gp/T/react-native-bundle-visualizer/UnknownApp/ios.bundle.map
info Done writing bundle output
info Done writing sourcemap output
Bundle is 4.53 MB in size (unchanged since last run)
Unable to map 1287124/4750750 bytes (27.09%)
✨  Done in 40.78s.
novonimo commented 3 years ago

sane error :

Unable to map 898765/3810818 bytes (23.58%)

IjzerenHein commented 2 years ago

I was able to run a couple weeks ago but failed continuously today without any error.

yarn run v1.22.4
$ /Users/xxx/xxx/xxx-expense/node_modules/.bin/react-native-bundle-visualizer --expo managed
Generating bundle...
                 Welcome to React Native!
                Learn once, write anywhere

info Writing bundle output to:, /var/folders/y8/7lh919_s0j38nkv2btgd7dy00000gp/T/react-native-bundle-visualizer/UnknownApp/ios.bundle
info Writing sourcemap output to:, /var/folders/y8/7lh919_s0j38nkv2btgd7dy00000gp/T/react-native-bundle-visualizer/UnknownApp/ios.bundle.map
info Done writing bundle output
info Done writing sourcemap output
Bundle is 4.53 MB in size (unchanged since last run)
Unable to map 1287124/4750750 bytes (27.09%)
✨  Done in 40.78s.

In what way does it fail? Output looks good to me..

mattrabe commented 2 years ago

I had this same problem, and at least in my case, the solution was knowing where to look for the output...

My experience:

I run react-native-bundle-visualizer (using any method). I get a CLI response with return code 0 (non-error). The "Unable to map" message is the last line in CLI output. And then... nothing happens...

My setup:

I host all of my projects on a different machine than the one I sit at. It is a server on my local network. I access everything over SSH on that host machine.

What went wrong:

The reason "nothing happened" is because *a browser window was automatically opened which displays the visualizer's output - but that browser happens to be on my host machine, not the one I am sitting in front of!*

I then found this ticket, wherein the OP and others appear to be reporting an error/failure, and at the same time the moderator sees nothing wrong... A little later, when I happened to turn on my server's monitor, there were all of my visualization tabs opened in a browser...

How to "fix" it:

@deathemperor @novonimo I recommend you suspect your browser setup. Where is your browser? Is it on your local machine, is it somewhere else, can it be opened automatically?

@IjzerenHein I think it would be useful if two things were added:

  1. The readme should explicitly state that a browser window will be automatically opened. If it had, I would have known exactly what to do since I deal with this all the time with my local-server setup.
  2. The last line of the CLI output should state something like "Output written to /path/to/output. Visit /path/to/browser/readable/file in a browser". The current "Unable to map" line appears as an error to anyone who doesn't happen to have a browser window automatically open in front of them.

Not everyone does local dev on the same machine where their project files are located (code-server users, some enterprise setups, anyone who runs a local server like I do). VS Code and others provide built-in support for sshing into a different machine. I turn off browsersync on projects, because they would always open on that different host machine... So to take this a step further, people with a setup similar to mine are also going to want the ability to disable the automatic browser opening, and instead manually go to the URL which needs to be outputted to CLI.

nedjs commented 1 year ago

Was also having this issue, for myself it was not actually an error but the output was not showing, this was due to me running it in WSL on Windows and it was not opening the webpage. Doing it in Powershell made it work file.

If you really want to run it in WSL you may be able to open the webpage manually which is located in Windows at: %TEMP%/react-native-bundle-visualizer/topia/output/explorer.html

jihoon416 commented 8 months ago

I was also running in WSL, and I had to go into /tmp/react-native-bundle-visualizer to find the explorer.html after running this tool in WSL

akshay-khapare commented 4 months ago

Generating bundle... Welcome to Metro v0.80.6 Fast - Scalable - Integrated

info Writing bundle output to:, C:\Users\aksha\AppData\Local\Temp\react-native-bundle-visualizer\Hinduzz\android.bundle info Writing sourcemap output to:, C:\Users\aksha\AppData\Local\Temp\react-native-bundle-visualizer\Hinduzz\android.bundle.map info Done writing bundle output info Done writing sourcemap output Bundle is 5.02 MB in size (unchanged since last run) === error === { bundles: [], errors: [ { bundleName: 'C:\Users\aksha\AppData\Local\Temp\react-native-bundle-visualizer\Hinduzz\android.bundle', code: 'InvalidMappingColumn', message: 'Your source map refers to generated column 14 on line 3, but the source only contains 1 column(s) on that line.\n' + 'Check that you are using the correct source map.', error: [AppError] } ] } how to solve this error

samkadam commented 2 weeks ago

@akshay-khapare have you found any solution on this issue ?