Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to debug w/ Chrome #164

Open
bartonhammond opened this issue Nov 15, 2016 · 8 comments
Open

Not able to debug w/ Chrome #164

bartonhammond opened this issue Nov 15, 2016 · 8 comments

Comments

@bartonhammond
Copy link
Owner

See facebook/react-native#10729

@wookiem
Copy link
Contributor

wookiem commented Nov 15, 2016

Yeah, I've been hitting this one for months. I'm only encountering this issue in files that contain multiple global functions (e.g. redux action files). I haven't encountered this in react component files which follow the pattern of stuffing most functions inside a single global react component class declaration.

My far from ideal workaround is to move the function under test to be the last function in the file. Doing this allows you to set breakpoints within this last function.

@wookiem
Copy link
Contributor

wookiem commented Jan 26, 2017

This issue was also being tracked in react-native and someone posted solution there...

Replace
function someFn() {}
with
const someFn = () => {}

There can't be ANY functions in the source file you're trying to set a breakpoint in.

https://github.com/facebook/react-native/issues/10729

@bartonhammond
Copy link
Owner Author

bartonhammond commented Jan 26, 2017 via email

@siemiatj
Copy link
Contributor

@bartonhammond I was thinking about rewriting everything to ES6 since we're transpiling with babel anyway. In fact I already did that in my project so I should be able to create a PR fairly easy.

@bartonhammond
Copy link
Owner Author

@siemiatj Sounds good - just make another PR! Many thanks

@ghost
Copy link

ghost commented Feb 28, 2017

I advise Vanilla JS if you can help it. Until the browsers (and node) add support for ES2015 imports/exports, you may be painting yourself into a corner unless you can get your binary packed up and off your plate. Just saying.

@siemiatj
Copy link
Contributor

I won't agree here. We're using babel to transpile JSX anyways, and almost all examples now are written with ES6 syntax. It's still vanilla JS :) Node won't support modules probably for a while since it's problematic to implement (the last thing I heard).

@astapinski
Copy link

Just FYI, you should try this again with RN 0.42. Evidently they refactored the source map generation, I tried it with our app in the areas where multiple functions in a file were having this issue and it seems to be fixed now.
https://medium.com/@david.aurelio/medium-fast-source-map-generation-for-react-native-ea5549007c18#.i9ru7x2ue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants