From d9da2612dcb491b85c113687ce48dcc3750f804e Mon Sep 17 00:00:00 2001 From: JiglioNero <43934531+JiglioNero@users.noreply.github.com> Date: Tue, 7 Jul 2020 12:54:26 +0300 Subject: [PATCH 1/2] Add solution of entry point not exist error for Expo on macOS to Known issues (#1337) * add lines to content of metro.config.json in smoke tests and add description of error to known issues in readme * Update README.md Co-authored-by: Yuri Skorokhodov * Update test/smoke/package/src/helpers/setupEnvironmentHelper.ts Co-authored-by: Yuri Skorokhodov * Update test/smoke/package/src/helpers/setupEnvironmentHelper.ts Co-authored-by: Yuri Skorokhodov Co-authored-by: Yuri Skorokhodov --- README.md | 3 ++- test/smoke/package/src/helpers/setupEnvironmentHelper.ts | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b1d8559e2..510223863 100644 --- a/README.md +++ b/README.md @@ -503,7 +503,8 @@ Debugger doesn't stop at breakpoints | Breakpoints require sourcemaps to be corr 'adb: command not found' | If you receive an error `adb: command not found`, you need to update your system Path to include the location of your *ADB* executable.The *ADB* executable file is located in a subdirectory along with your other Android SDK files. Targeting iPhone 6 doesn't work | There was a known issue with React Native ([#5850](https://github.com/facebook/react-native/issues/5850)) but it was fixed. Please upgrade your version of React Native. Can't communicate with socket pipe | (Linux only) If you have two workspaces open that only differ in casing, the extension will fail to communicate effectively. -"Add configuration" button doesn't work when trying to add debug configuration to `launch.json` | You may need to have to add in some json to `launch.json` manually. Please, see ([#985](https://github.com/Microsoft/vscode-react-native/issues/985)) +"Add configuration" button doesn't work when trying to add debug configuration to `launch.json` | You may need to have to add in some json to `launch.json` manually. Please, see ([#985](https://github.com/Microsoft/vscode-react-native/issues/985)). +Error `None of these files exist: * .vscode/exponentIndex` appears when running React Native apps via Expo | On some project configurations (mostly on macOS) there could be problems with running RN app via Expo for the first time. You can resolve this by explicitly adding `module.exports.watchFolders = ['.vscode'];` to your Metro config. This will help Metro bundler to find custom entry point generated by the extension needed to work with Expo. For details you can see the issue ([#1327](https://github.com/microsoft/vscode-react-native/issues/1327)). [Known-Issues](https://github.com/Microsoft/vscode-react-native/issues?q=is%3Aissue+label%3Aknown-issues) provides a complete list of active and resolved issues. diff --git a/test/smoke/package/src/helpers/setupEnvironmentHelper.ts b/test/smoke/package/src/helpers/setupEnvironmentHelper.ts index 2f3af5a40..462668165 100644 --- a/test/smoke/package/src/helpers/setupEnvironmentHelper.ts +++ b/test/smoke/package/src/helpers/setupEnvironmentHelper.ts @@ -252,7 +252,11 @@ module.exports.cacheStores = [ ]; // Redirect Haste Map cache -module.exports.hasteMapCacheDirectory = ".cache";`; +module.exports.hasteMapCacheDirectory = ".cache"; + +// Due to the fact that Metro bundler on MacOS has problems with scanning files and folders starting with a dot (hidden folders), for example './vscode', +// the first time when the packager starts, it cannot find the './vscode/exponentIndex.js' file. So we add this folder to scanning manually. +module.exports.watchFolders = ['.vscode'];`; fs.appendFileSync(metroConfigPath, patchContent); const contentAfterPatching = fs.readFileSync(metroConfigPath); console.log(`*** Content of a metro.config.js after patching: ${contentAfterPatching}`); From 9e97d3c61418ea9b4fa42d4d1eec4023063bbd4f Mon Sep 17 00:00:00 2001 From: Yuri Skorokhodov Date: Tue, 7 Jul 2020 17:25:46 +0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: RedMickey <33267199+RedMickey@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 510223863..be58bad5d 100644 --- a/README.md +++ b/README.md @@ -503,8 +503,8 @@ Debugger doesn't stop at breakpoints | Breakpoints require sourcemaps to be corr 'adb: command not found' | If you receive an error `adb: command not found`, you need to update your system Path to include the location of your *ADB* executable.The *ADB* executable file is located in a subdirectory along with your other Android SDK files. Targeting iPhone 6 doesn't work | There was a known issue with React Native ([#5850](https://github.com/facebook/react-native/issues/5850)) but it was fixed. Please upgrade your version of React Native. Can't communicate with socket pipe | (Linux only) If you have two workspaces open that only differ in casing, the extension will fail to communicate effectively. -"Add configuration" button doesn't work when trying to add debug configuration to `launch.json` | You may need to have to add in some json to `launch.json` manually. Please, see ([#985](https://github.com/Microsoft/vscode-react-native/issues/985)). -Error `None of these files exist: * .vscode/exponentIndex` appears when running React Native apps via Expo | On some project configurations (mostly on macOS) there could be problems with running RN app via Expo for the first time. You can resolve this by explicitly adding `module.exports.watchFolders = ['.vscode'];` to your Metro config. This will help Metro bundler to find custom entry point generated by the extension needed to work with Expo. For details you can see the issue ([#1327](https://github.com/microsoft/vscode-react-native/issues/1327)). +"Add configuration" button doesn't work when trying to add debug configuration to `launch.json` | You have to add some json configuration to `launch.json` manually. Please, see ([#985](https://github.com/Microsoft/vscode-react-native/issues/985)). +Error `None of these files exist: * .vscode/exponentIndex` appears when running React Native apps via Expo | On some project configurations (mostly on macOS) there could be problems with running RN app via Expo for the first time. You can resolve this by explicitly adding `module.exports.watchFolders = ['.vscode'];` to your Metro config. This will help Metro bundler to find the custom entry point generated by the extension needed to work with Expo. For details you can see the issue ([#1327](https://github.com/microsoft/vscode-react-native/issues/1327)). [Known-Issues](https://github.com/Microsoft/vscode-react-native/issues?q=is%3Aissue+label%3Aknown-issues) provides a complete list of active and resolved issues.