Help: VSCode won't connect to Packager

Hi, I’m brand new to Expo and React Native - so this is an absolute newbie question! I’m on an M1 Mac (ARM not Intel - not sure if this matters!).

I am following a tutorial on YouTube in building a sample app and am hitting a snag. I am developing the code in VSCode, launch a terminal inside VSCode and am running “npm start”. This brings up the Metro Bundler in Chrome. I click on “Run on iOS Simulator” and this brings up the app in a simulator and everything is fine so far.

Expo is configured to run on port 19000. This is my packager-info.json:
{
“devToolsPort”: 19002,
“expoServerPort”: 19000,
“packagerPort”: 19000,
“packagerPid”: null,
“expoServerNgrokUrl”: null,
“packagerNgrokUrl”: null,
“ngrokPid”: null,
“webpackServerPort”: null
}

In order to debug in VSCode, I have a launch.json configuration as follows:
“version”: “0.2.0”,
“configurations”: [
{
“name”: “Attach to packager”,
“cwd”: “${workspaceFolder}”,
“type”: “reactnative”,
“request”: “attach”
}
]

I also set the react-native.packager.port setting in VSCode to 19000.

I now go to VSCOde, click on “Run and Debug”, choose the “Attach to packager” configuration and click on the green arrow and I get the following error in my OUTPUT window.

[Info] Packager is already running.

[Warning] Error: React Native Packager running outside of VS Code. If you want to debug please use the ‘Attach to packager’ option

The little blue line under the debug keeps going round and round and control never comes to a breakpoint I’ve set. Can you please let me know what I’m doing wrong!

Thanks

$ expo diagnostics
WARNING: expo-cli has not yet been tested against Node.js v16.1.0.
If you encounter any issues, please report them to Issues · expo/expo-cli · GitHub

expo-cli supports following Node.js versions:

  • =12.13.0 <13.0.0 (Maintenance LTS)

  • =14.0.0 <15.0.0 (Active LTS)

  • =15.0.0 <17.0.0 (Current Release)

    Expo CLI 4.4.7 environment info:
    System:
    OS: macOS 11.3.1
    Shell: 5.8 - /bin/zsh
    Binaries:
    Node: 16.1.0 - /opt/homebrew/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.13.0 - /opt/homebrew/bin/npm
    Watchman: 4.9.0 - /opt/homebrew/bin/watchman
    Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
    SDKs:
    iOS SDK:
    Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK:
    API Levels: 30
    Build Tools: 30.0.3
    System Images: android-30 | Google APIs Intel x86 Atom
    IDEs:
    Android Studio: 4.2 AI-202.7660.26.42.7351085
    Xcode: 12.5/12E262 - /usr/bin/xcodebuild
    npmPackages:
    expo: ~41.0.1 => 41.0.1
    react: 16.13.1 => 16.13.1
    react-dom: 16.13.1 => 16.13.1
    react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz => 0.63.2
    react-native-web: ~0.13.12 => 0.13.18
    Expo Workflow: managed

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.