From 9b528cc8939a0f10ccd2fe3f21fafc0376f1f158 Mon Sep 17 00:00:00 2001 From: Alexander Janssen Date: Fri, 18 Oct 2024 00:00:49 +0200 Subject: [PATCH] fix(expo): check if option is not undefined closes #28488 (#28489) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Current Behavior NX Cannot read properties of undefined (reading 'trim') TypeError: Cannot read properties of undefined (reading 'trim') at /path/node_modules/@expo/package-manager/build/node/NpmPackageManager.js:80:22 at Array.map () at NpmPackageManager.parsePackageSpecs (/path/node_modules/@expo/package-manager/build/node/NpmPackageManager.js:79:14) at NpmPackageManager.addAsync (/path/node_modules/@expo/package-manager/build/node/NpmPackageManager.js:34:56) at installPackagesAsync (/path/node_modules/@expo/cli/build/src/install/installAsync.js:178:30) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async installAndUpdatePackageJson (/path/node_modules/@nx/expo/src/executors/install/install.impl.js:33:5) at async buildExecutor (/path/node_modules/@nx/expo/src/executors/update/update.impl.js:13:9) at async getLastValueFromAsyncIterableIterator (/path/node_modules/nx/src/utils/async-iterator.js:15:19) at async iteratorToProcessStatusCode (/path/node_modules/nx/src/command-line/run/run.js:39:25) ## Expected Behavior › Installing 1 SDK 51.0.0 compatible native module using npm npm install ## Related Issue(s) Fixes #28488 --- packages/expo/src/executors/install/install.impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/expo/src/executors/install/install.impl.ts b/packages/expo/src/executors/install/install.impl.ts index 52f6b8fb97a8b..27f3006ac1ca1 100644 --- a/packages/expo/src/executors/install/install.impl.ts +++ b/packages/expo/src/executors/install/install.impl.ts @@ -84,7 +84,7 @@ function createInstallOptions(options: ExpoInstallOptions) { // when true, does not need to pass the value true, just need to pass the flag in kebob case acc.push(`--${names(k).fileName}`); } - } else { + } else if (v !== undefined) { acc.push(`--${names(k).fileName}`, v); }