software-mansion / radon-ide

VSCode extension that turns your editor into a fully fledged IDE for React Native and Expo.
https://ide.swmansion.com
Other
1.01k stars 35 forks source link

specifying appRoot in launch configuration does not work #722

Open pietgk opened 2 weeks ago

pietgk commented 2 weeks ago

Description

Specifying appRoot in launch.json configuration does not work

    {
      "type": "radon-ide",
      "request": "launch",
      "name": "Radon IDE panel",
      "appRoot": "/Users/grop/dev/app/development", // equal to ${workspaceFolder}
      "isExpo": true,
      "eas": {
        "ios": {
          "profile": "development_simulator"
        },
        "android": {
          "profile": "development_simulator", 
        }
      }
    }

Gives popup with

The app root folder does not exist in the workspace at /Users/grop/dev/app/development.

Removing the appRoot entry result in log:

2024-11-12 08:38:17.707 [warning] Found multiple **/node_modules/react-native/package.json files in the workspace
2024-11-12 08:38:17.904 [info] Found app root folder: /Users/grop/dev/app/development

I need a way to specify appRoot, as i have multiple metro.config.js in my repo (disabled the other one to report this issue in the minimal context).

Thx in advance for any help.

Environment

The logs also report (i do not know if this is relevant or not)

2024-11-12 08:38:24.892 [error] EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, scandir '/Users/grop/Library/Application Support/Code/User/workspaceStorage/9c461c1513df07c3a0457e3bfc865a6b/redhat.java'
    at Function.e (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:9057)
    at Object.readDirectory (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:7197) Unhandled promise rejection
pietgk commented 2 weeks ago

Solved it (read the fine manual) and changed appRoot to "."

pietgk commented 2 weeks ago

closing it

kmagiera commented 2 weeks ago

I will reopen it as there's a small improvement we could make here. We can verify the app root is a relative path and provide some more helpful error message.

In general, the type of settings you check into the version control should never have user-specific absolute paths as they are rarely portable.

pietgk commented 2 weeks ago

i tried to make explicit what ${workspaceFolder} value was :-), as in the comment explained. agree on being nicer on error feedback (maybe include link to docs page).