`getInitializationEntries` contents causes incorrect `Error` position
See original GitHub issueEnvironment
Both iOS and Android, with or without hermes.
Description
When throwing an error inside a repack app (including the TesterApp) the line + column combination is not matching the actual position in the bundle file, therefore the source map lookup ends up on the wrong file/line. The produced source map itself is correct and maps perfectly if getting the position by inspecting the bundle manually or running the bundle via node.
This seems to be caused by the import of react-native
package somehow.
Reproducible Demo
Edit TesterApp/index.js
to be:
throw new Error('Lol');
and remove ReactNative.getInitializationEntries
spread from webpack.config.js
and observe that the line+column thrown in RN are correct. Add back ReactNative.getInitializationEntries
and see that it doesn’t match anymore.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
E4 Preference Initializer won´t get called - Stack Overflow
I´m using Eclipse 4.5.1 on a win7 x64 I googled a lot and found a lot of Threads concerning this, but I just...
Read more >Detecting Positioning Errors and Estimating Correct ... - PLOS
The main problem addressed in this paper is the positioning error in such systems. All positioning systems have errors mainly caused by ...
Read more >A Webpack-based toolkit to build your React Native ...
`getInitializationEntries` contents causes incorrect `Error` position ... is not matching the actual position in the bundle file, ...
Read more >The repack from callstack - GithubHelp
`getInitializationEntries` contents causes incorrect `Error` position ... is not matching the actual position in the bundle file, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, it needs some more verification on our repo, but I managed to get the
TesterApp
to work with these settings:Hi, after throughout investigation we know that: without any changes to the webpack config we’ve got following results:
with suggested changes (disabling any comments):
/*webpackChunkName*/
) will be removed as well so just keep that in mind and be careful.Turned out that comments that start with
@license
and!
like those generated by thewebpack
😃 caused JSC to return wrong column number when Error was thrown. In the dev mode before ourindex
file there is a different type of comment and probably that’s the reason why it works properly. Surprisingly on Hermes everything should work just fine!