expo / vscode-expo

Expo Tools keep you productive with debugging, IntelliSense, and prebuild previews
https://marketplace.visualstudio.com/items?itemName=expo.vscode-expo-tools
MIT License
433 stars 11 forks source link

`Expo debug: waiting for bundler on 127.0.0.1` getting 404 for `http://127.0.0.1/json/list` #235

Open stefan-schweiger opened 1 year ago

stefan-schweiger commented 1 year ago

Description of the bug

When I start the debugger via "Expo: Debug Expo app on a device or simulator, using Hermes" I get an popup which tells me Expo debug: waiting for bundler on 127.0.0.1 but nothing happens. From monitoring the network traffic I see that requests are made to http://127.0.0.1/json/list which just error out with 404.

The weird thing is that the debugger was working for me a few weeks ago and also just accessing http://127.0.0.1 returns a valid response:

{
   "id":"b130f910-19af-4ad5-aa28-a59ceff4fea0",
   "createdAt":"2023-10-27T12:24:17.378Z",
   "runtimeVersion":"exposdk:49.0.0",
   "launchAsset":{
      "key":"bundle",
      "contentType":"application/javascript",
      "url":"http://127.0.0.1:8081/index.bundle?platform=ios&dev=true&hot=false&lazy=true"
   },
   "assets":[

   ],
   "metadata":{

   },
   "extra":{
      "eas":{

      },
      "expoClient":{
         "name":"<MY_APP_NAME>",
         "slug":"<MY_SLUG>",
         "owner":"<MY_ORG>",
         "version":"1.0.6",
         "orientation":"portrait",
         "icon":"./assets/images/icon_dev.png",
         "backgroundColor":"#FFFFFF",
         "scheme":"<MY_SCHEME>",
         "userInterfaceStyle":"light",
         "jsEngine":"hermes",
         "splash":{
            "image":"./assets/images/splashscreen.png",
            "resizeMode":"contain",
            "backgroundColor":"#FFFFFF",
            "imageUrl":"http://127.0.0.1:8081/assets/./assets/images/splashscreen.png"
         },
         "assetBundlePatterns":[
            "**/*"
         ],
         "ios":{
            "supportsTablet":true,
            "bundleIdentifier":"<MY_SCHEME>",
            "config":{
               "usesNonExemptEncryption":false
            },
            "infoPlist":{
               "NSCameraUsageDescription":"Allow $(PRODUCT_NAME) to access your camera"
            }
         },
         "android":{
            "adaptiveIcon":{
               "foregroundImage":"./assets/images/adaptive-icon_dev.png",
               "backgroundColor":"#4b4b64",
               "foregroundImageUrl":"http://127.0.0.1:8081/assets/./assets/images/adaptive-icon_dev.png"
            },
            "package":"<MY_SCHEME>",
            "permissions":[
               "android.permission.READ_EXTERNAL_STORAGE",
               "android.permission.WRITE_EXTERNAL_STORAGE",
               "android.permission.DOWNLOAD_WITHOUT_NOTIFICATION",
               "android.permission.ACCESS_NETWORK_STATE",
               "android.permission.CAMERA"
            ]
         },
         "extra":{
            "appEnvironment":"localdevk8s"
         },
         "runtimeVersion":{
            "policy":"sdkVersion"
         },
         "plugins":[
            [
               "expo-build-properties",
               {
                  "ios":{
                     "flipper":true,
                     "newArchEnabled":false
                  },
                  "android":{
                     "newArchEnabled":false,
                     "enableProguardInReleaseBuilds":true
                  }
               }
            ],
            "@config-plugins/react-native-blob-util",
            "@config-plugins/react-native-pdf",
            [
               "react-native-vision-camera",
               {
                  "enableCodeScanner":true
               }
            ]
         ],
         "_internal":{
            "isDebug":false,
            "projectRoot":"<MY_SOURCE_PATH>",
            "dynamicConfigPath":"<MY_SOURCE_PATH>/app.config.js",
            "staticConfigPath":{

            },
            "packageJsonPath":"<MY_SOURCE_PATH>/package.json",
            "pluginHistory":{
               "react-native-blob-util":{
                  "name":"react-native-blob-util",
                  "version":"0.19.2"
               },
               "react-native-pdf":{
                  "name":"react-native-pdf",
                  "version":"6.7.1"
               },
               "react-native-vision-camera":{
                  "name":"react-native-vision-camera",
                  "version":"3.5.1"
               }
            }
         },
         "sdkVersion":"49.0.0",
         "platforms":[
            "ios",
            "android",
            "web"
         ],
         "iconUrl":"http://127.0.0.1:8081/assets/./assets/images/icon_dev.png",
         "hostUri":"127.0.0.1:8081"
      },
      "expoGo":{
         "debuggerHost":"127.0.0.1:8081",
         "logUrl":"http://127.0.0.1:8081/logs",
         "developer":{
            "tool":"expo-cli",
            "projectRoot":"<MY_SOURCE_PATH>"
         },
         "packagerOpts":{
            "dev":true
         },
         "mainModuleName":"index",
         "__flipperHack":"React Native packager is running"
      },
      "scopeKey":"@anonymous/<MY_SLUG>-681e8f93-4be3-495e-9a56-ebf8d50c2ef5"
   }
}

Expected behavior

Debugger should start correctly

Actual behavior

image

Additional context

Extension version 1.0.7 (but I have also tried the current pre-release)

expo-env-info 1.0.5 environment info:
  System:
    OS: macOS 14.0
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.1.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.0 - /opt/homebrew/bin/npm
    Watchman: 2023.10.23.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.14.2 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 23.0, iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 15.0/15A240d - /usr/bin/xcodebuild
  npmPackages:
    expo: ^49.0.11 => 49.0.16 
    react: 18.2.0 => 18.2.0 
    react-dom: 18.2.0 => 18.2.0 
    react-native: 0.72.6 => 0.72.6 
    react-native-web: ~0.19.8 => 0.19.9 
  Expo Workflow: managed
rezio-gary commented 12 months ago

same here

byCedric commented 11 months ago

Hi all! Can either one of you create a repository for me to test a few things? I suspect it might be related to the dev server responding to <bundlerUrl>/json/list as being a page or screen of your app, instead of returning the correct CDP response.

CDP response from the protocol specification: image

stefan-schweiger commented 11 months ago

@byCedric https://github.com/stefan-schweiger/expo-debugger-bug maybe there is a bit more to trim, but I can simulate the behavior with this (in expo go as well as in my own devclient)

stefan-schweiger commented 11 months ago

@byCedric if you find the time can you let me know if the repro behaves the same for you?

stefan-schweiger commented 9 months ago

@byCedric any update on this?

Akuma-U1 commented 9 months ago

Hi, I'm having the same issue as well. Would love updates.

ctrlx-altf4 commented 5 months ago

I got the same issue too.

nwazuo commented 4 months ago

I got this issue too.

jar145 commented 4 months ago

I'm having the same issues as well

Stumblor commented 3 months ago

Just worked it out, at least for me.

  1. Run in terminal tab npx expo start
  2. In terminal tab start android debugging (or another) by pressing a
  3. In VSCode debugger, start Debug Expo app

Voilà