react-native-bundle-visualizer: Source-map-explorer error
Hello, Recently, we moved to yarn workspace monorepo although I’m not sure if this is happening because of it since I haven’t used the library in some time.
There lib is generating the bundle and sourcemap, but it seems to be corrupted.
Generating bundle...
warning: the transform cache was reset.
Welcome to Metro!
Fast - Scalable - Integrated
info Writing bundle output to:, /var/folders/z0/1fmtx0f56_z4f2mgch3tyfsm0000gn/T/react-native-bundle-visualizer/app/ios.bundle
info Writing sourcemap output to:, /var/folders/z0/1fmtx0f56_z4f2mgch3tyfsm0000gn/T/react-native-bundle-visualizer/app/ios.bundle.map
info Done writing bundle output
info Done writing sourcemap output
Bundle is 85.18 MB in size (unchanged since last run)
=== error === {
bundles: [],
errors: [
{
bundleName: '/var/folders/z0/1fmtx0f56_z4f2mgch3tyfsm0000gn/T/react-native-bundle-visualizer/app/ios.bundle',
code: 'InvalidMappingLine',
message: 'Your source map refers to generated line 17, but the source only contains 16 line(s).\n' +
'Check that you are using the correct source map.',
error: [AppError]
}
]
}
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 11
- Comments: 37
Hey folks,
I have pushed a fix, which reverts the
minify
flag introduced in PR.If someone wants to help in testing, please remove the existing package and install it from the following command:
yarn add -D "https://github.com/IjzerenHein/react-native-bundle-visualizer.git#fix-remove-minify-false"
I tested this on the latest react-native: 0.71.6 and expo SDK: 48.0.10, and it works fine.
I have also added a troubleshooting section to use v3.1.3, if they encounter negative line error, which may appear in versions around >=0.70.0 & <=0.71.3.
Also, tested on RN64 and expo SDK 42, all green there as well.
I will be releasing a new version with this fix soon 🤞
react-native: 0.72.^ yahh i same issue, and we can comment line ‘–minify’, in
/node_modules/react-native-bundle-visualizer/src/react-native-bundle-visualizer.js
to solved.Same here, no metro overrides, completely new project =(
I installed this version as a dev dependency, and ran locally to fix
Add this line:
node_modules/react-native-bundle-visualizer/src/react-native-bundle-visualizer.js
react-native-bundle-visualizer-npm-3.1.3-5b29b2c181.patch
Works for me Thanks! 🥰🥰🏆
Not working
@nicolasburtey Thanks for the repro. I briefly took a look at that and looks like it’s probably related to how
metro.config.js
is overriden. I don’t have a clear explanation of the issue yet, I will try to look for details. Probably this could be related but need to dig further. I also tried putting minifierPath tometro-minify-uglify
but it doesn’t seem to work.I will try to comeback soon with an update. 👍
Confirm that this is working for react-native: 0.72.4 react-native-bundle-visualizer: 3.1.3
not work for Expo 49
You can also run
npx react-native-bundle-visualizer@3.1.0
. If you don’t want to save it as dev dependency.@hurali97 thanks for looking into it some, I am not sure if that’s the only issue as it’s stated it started w/ RN 70 version but at least in my case my project is still on RN 68. I was able to work around the issue though as noted in my previous comment above.
Hi guys,
I have a few comments to discuss:
I need some confirmation from the community, does latest
react-native 0.71.4
works for you with latestreact-native-bundle-visualizer 3.1.3
?I tried on my system and it works without any fuss.
So I will wait until I get some confirmations if that’s the case for others and then reverting the changes of setting minification to false in this PR, so that we benefit from minification while visualizing the bundles.
Hey folks,
Sorry for not being active. But I think I can devote some time to it now. I will be testing this on:
Let’s see how far do I get in terms of investigating and then getting it fixed 🤞
@frankcalise thanks for the the comment. But I’m not sure I understand what should I do? The branch
#fix-set-minify-to-false
doesn’t exist anymore and my version of metro isn’t usingterser
as a minifierThis is probably related to this: https://github.com/IjzerenHein/react-native-bundle-visualizer/issues/116
Try this temp fix: https://github.com/IjzerenHein/react-native-bundle-visualizer/issues/116#issuecomment-1427042593
The latest metro has a fix for this issue. see the linked PR on the above issue here (although I don’t know what it means for in terms of a new release for this package)
I’m using react-native-cli and
"react-native-bundle-visualizer": "^3.1.3"
seen the same issue. RN 0.71.2 and react-native-bundle-visualizer 3.1.3
tried with 3.1.0 and have a different error message, so it seems there is a difference in behavior between 3.1.0 and 3.1.3:
ok I see 3.1.3 is supposed to fix RN 0.71 compatibility, I guess this is why I had different behavior. unfortunately seems none version works for me.
@hurali97 related repo if you want to try locally: https://github.com/GaloyMoney/galoy-mobile