vscode-react-native icon indicating copy to clipboard operation
vscode-react-native copied to clipboard

unable to set break points in my code

Open gilesbradshaw opened this issue 10 years ago • 7 comments

Actual Behavior

I just get 'unverified break point' and it's never hit

here is code I am trying to set break point on..

const ReferenceLinks = compose(createContainer(frags))
  (({referenceDescriptions, navigator, header})=> 
  (
    <ListView
      renderHeader={()=><View>{header}</View>}
      //renderScrollComponent={props => <RecyclerViewBackedScrollView {...props} />}
      style={styles.listView}
      contentContainerStyle={styles.listViewContent}
      dataSource = {lv.cloneWithRows(referenceDescriptions)}
      renderSeparator={(sectionID, rowID) => <View key={`${sectionID}-${rowID}`} style={styles.separator} />}
      renderRow = {(row)=>
        <View style={{flexDirection: 'row', justifyContent: 'center'}}>
          <ReferenceLink
            referenceDescription={row.node}
            navigator={navigator}/>
        </View>
      }>
    </ListView>
  ));


Expected Behavior

should be set ok and hit

Software versions

  • React-Native VS Code extension version: 0.1.3
  • VSCode version: 0.10.11
  • OS platform and version: mac os el capitain
  • React Native version: 0.22.2

Outputs (Include if relevant)

  • Output of the Debug Console (View -> Toggle Debug Console):
  • Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox):
  • Output of the Developer Tools console (Help -> Toggle Developer Tools -> Select Console tab):

gilesbradshaw avatar Apr 09 '16 03:04 gilesbradshaw

@gilesbradshaw In which exact line are you trying to set the breakpoint?

digeff avatar Apr 11 '16 15:04 digeff

Can you hit breakpoints in other parts of the program? What happens if you use a hard breakpoint as in: debugger;

digeff avatar Apr 11 '16 20:04 digeff

.In which exact line

<ListView>
  • I change it now to
{ 
    return <ListView>

(trying to hit return above)

. Can you hit breakpoints in other parts of the program?

sort of but when I put in a break point it seems to stop at a different place in the editor..

.What happens if you use a hard breakpoint as in: debugger;

It kind of works although again it shows the breakpont hit in the wrong place (but I can watch function params).

If u wanted to try my app you could do

git clone https://github.com/gilesbradshaw/ua-ql-mobile.git awesome2
cd awesome2
npm i

debugger gets hit when you pic "fourth" or "fifth" in navbar at top "debugger" is in components/referencelinks.js line 55

(if u did try and I've removed debugger - just add it above return on line 55)

gilesbradshaw avatar Apr 11 '16 23:04 gilesbradshaw

I've had a look at your project, and I believe that this is an issue with the sourcemaps being generated.

If I disable sourcemaps and run your project, when I navigate to the "Fourth" tab then I hit the debugger; statement that you added, which appears to be on line 98495 of the index.ios.bundle. However if I query the sourcemaps for that position, it gives me an invalid location:

> smc.originalPositionFor({line: 98495, column: 5})
{ source: '../../components/ReferenceLinks.js',
  line: 85,
  column: 0,
  name: null }

Note that ReferenceLinks.js only has 77 lines in the source. I suspect that there is some babel transformation which is not treating source maps correctly, and so the end result does not correctly map the bundle to the original sources. This isn't something that we can fix on our end, and I'm afraid I don't know where specifically things have gone wrong for you; I'm not familiar with the babel plugins you are using.

MSLaguana avatar Apr 12 '16 21:04 MSLaguana

Thanks a lot for looking - I'll have a play with the babel plugins

gilesbradshaw avatar Apr 13 '16 00:04 gilesbradshaw

@gilesbradshaw Please do tell us if you find out how to generate the correct source maps!

digeff avatar Apr 13 '16 00:04 digeff

Sounds like it's a source map generation issue. I will close the bug for now. Please contact us again to reopen the bug if it's not the case.

changsi-an avatar Aug 30 '16 17:08 changsi-an