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

Point VSCode launch config to react-native-editor root #4575

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

hypest
Copy link
Contributor

@hypest hypest commented Feb 11, 2022

Currently, trying to start (attach) the debugger provided by the vscode-react-native extension ends up in error because the extension doesn't detect the gutenberg-mobile root as the RN app root. Error:

An error occurred while attaching debugger to the application. Seems to be that you are trying to debug from within directory that is not a React Native project root. 
 If so, please, follow these instructions: [https://github.com/microsoft/vscode-react-native#customization]() (error code 604) (error code 1410)

Screenshot 2022-02-11 at 15 43 13

This PR updates the launch configuration to point to the react-native-editor package root, making the extension happy.

To test:

  1. In a terminal, start Metro (npm ci followed by npm run start:reset), and possibly the demo app as well (npm run core android)
  2. Open VSCode from the root of the gutenberg-mobile checkout
  3. Git the F5 key or use the "Run > Start Debugging" menu action to attach the debugger.
  4. No error should be presented by VSCode, and a Established a connection with the Proxy (Packager) to the React Native application message should be visible in the "DEBUG CONSOLE" pane in VSCode
  5. If you want to test further, place a breakpoint in
    require( './setup' ).default();
  6. In the demo app, open the debug menu and hit "Debug"
  7. Some moments later, debugger should break at the line above.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes more info and have added them to RELEASE-NOTES.txt if necessary.

@hypest hypest requested a review from SiobhyB February 11, 2022 13:52
Copy link
Contributor

@SiobhyB SiobhyB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and confirmed I'm able to use the debugger with this change 🚀 🚢

@hypest hypest merged commit 3ab1c3d into develop Feb 18, 2022
@hypest hypest deleted the fix/vscode-launch-point-to-react-native-editor branch February 18, 2022 11:48
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

Successfully merging this pull request may close these issues.

2 participants