Reputation: 7022
Chrome debugging in React-Native is conceptually great. If it works.
let, get, set etc. There are lots of es6, es7 features that Chrome doesn't allow you to set debugging breaks at. And with async await the cursor seems to jump all over the place at times, often to places where you know it can't be. Utterly confusing.
Any suggestions on making Chrome debugging work more reliably? (on the latest Canary)
Upvotes: 2
Views: 716
Reputation: 1212
I think it's an issue about Babel, not React-Native or Chrome. React-native packager use Babel for transfer ES7 & ES6 features to ES5 code, and generate an .map
file to let Chrome or other browser know how to mapping code between ES7/ES6 and ES5 file when you debugging. Some features are hard(or impossible) to mapping perfect, so you will confuse if set break point in source code. In my experience, debug in ES5 code is a better choice, and some feature like async/await
is hard to debug at this time, so you should use them careful.
See this article about js sourcemap.
Upvotes: 2