From e2169cbbd4bd15500372b53166bff4423fb5251b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 22 Feb 2023 18:24:23 +0100 Subject: [PATCH] ios: use --openssl-legacy-provider with iOS builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue with following failure: ``` Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:130:10) at stableHash (/Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro-cache/src/stableHash.js:19:8) at JsTransformer.getCacheKey (/Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro/src/JSTransformer/worker.js:471:7) at getTransformCacheKey (/Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro/src/DeltaBundler/Transformer/getTransformCacheKey.js:39:29) at new Transformer (/Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro/src/DeltaBundler/Transformer.js:147:28) at /Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro/src/Bundler.js:54:29 at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5) { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' ``` https://roytuts.com/how-to-fix-err_ossl_evp_unsupported-in-react-js-application/ Signed-off-by: Jakub SokoĊ‚owski --- ios/StatusIm.xcodeproj/project.pbxproj | 4 ++-- nix/mobile/ios/shells/nodejs.nix | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ios/StatusIm.xcodeproj/project.pbxproj b/ios/StatusIm.xcodeproj/project.pbxproj index 36ad00e186..5fb82a7b2c 100644 --- a/ios/StatusIm.xcodeproj/project.pbxproj +++ b/ios/StatusIm.xcodeproj/project.pbxproj @@ -526,7 +526,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --max-old-space-size=16384 \"\n\nbash -x ../node_modules/react-native/scripts/react-native-xcode.sh > ./react-native-xcode.log 2>&1"; + shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --openssl-legacy-provider --max-old-space-size=16384 \"\n\nbash -x ../node_modules/react-native/scripts/react-native-xcode.sh > ./react-native-xcode.log 2>&1"; }; 0F876BD5356F61BF142A01A0 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; @@ -584,7 +584,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --max-old-space-size=16384 \"\n\nbash -x ../node_modules/react-native/scripts/react-native-xcode.sh > ./react-native-xcode.log 2>&1"; + shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --openssl-legacy-provider --max-old-space-size=16384 \"\n\nbash -x ../node_modules/react-native/scripts/react-native-xcode.sh > ./react-native-xcode.log 2>&1"; }; 3AAD2AD724A3A60E0075D594 /* Run Script */ = { isa = PBXShellScriptBuildPhase; diff --git a/nix/mobile/ios/shells/nodejs.nix b/nix/mobile/ios/shells/nodejs.nix index 3ce093373d..49159a437e 100644 --- a/nix/mobile/ios/shells/nodejs.nix +++ b/nix/mobile/ios/shells/nodejs.nix @@ -1,6 +1,9 @@ { mkShell, deps }: mkShell { + # Fix for ERR_OSSL_EVP_UNSUPPORTED error. + NODE_OPTIONS = "--openssl-legacy-provider"; + # check if node modules changed and if so install them shellHook = '' export STATUS_MOBILE_HOME=$(git rev-parse --show-toplevel)