Wrong source map is generated
The source maps generated by the react-native packager seem to not be generated properly. We've seen in several projects that the mapping to/from around the React Tags code seems to not be correct.
For example, a user reported this issue: https://github.com/Microsoft/vscode-react-native/issues/206#issuecomment-209109389 in our project, and the root cause of the issue is because the source map file generated by the react-native packager is not correctly mapping to the original source code (The original source code has 76 lines, and the .map files point to line 85 on that file).
Could you provide an example repo where we can reproduce this issue?
Yes, @gilesbradshaw was having this issue on his app, and he told us we can install it by doing:
git clone https://github.com/gilesbradshaw/ua-ql-mobile.git awesome2
cd awesome2
npm i
In https://github.com/Microsoft/vscode-react-native/issues/206#issuecomment-209109389 he describes exactly where to put the breakpoint to reproduce this issue (Which is also where the source maps aren't being correctly generated).
Thanks for looking let me know if you cannot replicate with that repo
I also had this issue recently where sources maps were off by ~10-20 lines. It only happened in component files with jsx.
The more import-statements, jsx-syntax or es6-classes in the module, the more difference is between correct lines and the generated source map.
@satya164 Any updates on this?
I've found a different symptom: the source maps are pointing to the entirely wrong files. Has anyone else experienced this?
@spikebrehm we are experiencing the same. At first by combining some of the imports we could get it back to work, however when the project goes, we lost more and more correct file mapping when debugging in Chrome. We have to try debugging in Nuclide to get to the exact breakpoints in exact files in those cases but it's not as powerful as Chrome.
@facebook-github-bot label Icebox
Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/wrong-source-map-is-generated
ProductPains helps the community prioritize the most important issues thanks to its voting feature. It is easy to use - just login with GitHub.
Also, if this issue is a bug, please consider sending a PR with a fix. We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.
@facebook-github-bot close
@charpeni tells me to close this issue. If you think it should still be opened let us know why.
I also see this occurring. I'm getting completely wrong filenames from sourcemaps.
I have the problem where iOS works, but android bundlemap is of with 10-20 lines. Is this a common issue around here? I created an issue on it: https://github.com/facebook/react-native
I'm having this... rn 0.44
I too am having this issue - has anyone else been able to solve it? @brunolemos @vongohren - thanks!
Rn 0.48 still has this issue on android release build.
I'm seeing something similar, but from my research I don't believe the issue is with the source maps rather the raw stack traces point to the wrong locations in the bundle. As an example if we do throw new Error('test'); at 479:1837 in our bundle the actual location in the stack trace is 479:2150 which has nothing to do with the code path that leads to the error being thrown
EDIT: This is specifically for Android. Testing on iOS both the location in the bundled file and the mapped location with source map is correct.
@charpeni can we reopen this?
@k0nserv Sure.