facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
117.68k stars 24.16k forks source link

ERR_OSSL_EVP_UNSUPPORTED , Command PhaseScriptExecution failed with a nonzero exit code #38763

Closed techamit95ch closed 1 year ago

techamit95ch commented 1 year ago

Description

Hi I am using react native@0.67.5, it's an old project, but officially it's running

My node version is v18.17.0

And my openssl version : OpenSSL 3.0.10 1 Aug 2023 (Library: OpenSSL 3.0.10 1 Aug 2023) And I am m1 MacBook Pro user.

and I am continuously getting this error.


 node /Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/react-native/cli.js bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/amitchakraborty/Library/Developer/Xcode/DerivedData/VulcanEleven-fauzipknssuyavfknzrdbgfdkwla/Build/Intermediates.noindex/ArchiveIntermediates/VulcanEleven/BuildProductsPath/ReleaseProduction-iphoneos/main.jsbundle --assets-dest /Users/amitchakraborty/Library/Developer/Xcode/DerivedData/VulcanEleven-fauzipknssuyavfknzrdbgfdkwla/Build/Intermediates.noindex/ArchiveIntermediates/VulcanEleven/BuildProductsPath/ReleaseProduction-iphoneos/VulcanEleven.app --minify false
warning: the transform cache was reset.
                    Welcome to Metro!
              Fast - Scalable - Integrated

watchman warning:  Recrawled this watch 39 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del '/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2' ; watchman watch-project '/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2'`

Recrawled this watch 39 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del '/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2' ; watchman watch-project '/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2'`

Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at stableHash (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro-cache/src/stableHash.js:19:8)
    at Object.getCacheKey (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro-transform-worker/src/index.js:593:7)
    at getTransformCacheKey (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/DeltaBundler/getTransformCacheKey.js:24:19)
    at new Transformer (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/DeltaBundler/Transformer.js:48:9)
    at /Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/Bundler.js:22:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
error Cannot read properties of undefined (reading 'transformFile').
TypeError: Cannot read properties of undefined (reading 'transformFile')
    at Bundler.transformFile (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/Bundler.js:48:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.transform (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/lib/transformHelpers.js:101:12)
    at async processModule (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:18)
    at async traverseDependenciesForSingleFile (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/DeltaBundler/traverseDependencies.js:131:3)
    at async Promise.all (index 0)
    at async initialTraverseDependencies (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/DeltaBundler/traverseDependencies.js:114:3)
    at async DeltaCalculator._getChangedDependencies (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:164:25)
    at async DeltaCalculator.getDelta (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:94:16)
    at async DeltaBundler.buildGraph (/Users/amitchakraborty/Desktop/Office/React_Native/defi11-react-native-v2/node_modules/metro/src/DeltaBundler.js:50:5)
info Run CLI with --verbose flag for more details.
Command PhaseScriptExecution failed with a nonzero exit code ,

I have reinstalled project several times, cleared node modes several time

I google tried to find solution although , there I found I have to add export NODE_OPTIONS=--openssl-legacy-provider in ~/.bashrc and ~/.zshrc, Which I did. It worked for react-native run-ios and react-native run-android

but when I am trying to build from Xcode or I am trying to archive project for test flight I am getting previous error again

Can you help me to resolve this issue?

Here is my package.json's dependencies

"dependencies": {
        "@biconomy/mexa": "2.0.35",
        "@coinbase/cbpay-js": "^1.6.0",
        "@craftzdog/react-native-buffer": "^6.0.5",
        "@ethereumjs/tx": "^3.3.2",
        "@gorhom/animated-tabbar": "2.1.1",
        "@gorhom/bottom-sheet": "^4",
        "@react-native-clipboard/clipboard": "^1.11.1",
        "@react-native-community/hooks": "^2.8.1",
        "@react-native-community/masked-view": "^0.1.11",
        "@react-native-community/netinfo": "^9.3.0",
        "@react-native-community/slider": "^4.4.2",
        "@react-native-firebase/analytics": "^12.9.3",
        "@react-native-firebase/app": "^12.9.3",
        "@react-native-firebase/dynamic-links": "^12.9.3",
        "@react-native-firebase/messaging": "^12.9.3",
        "@react-navigation/bottom-tabs": "^6.0.5",
        "@react-navigation/core": "^6.0.3",
        "@react-navigation/devtools": "^6.0.10",
        "@react-navigation/native": "^6.0.4",
        "@react-navigation/native-stack": "^6.6.1",
        "@react-navigation/stack": "^5.x",
        "@reduxjs/toolkit": "^1.8.5",

        "@shopify/flash-list": "^1.4.0",
        "@tanstack/react-query": "^4.13.0",
        "@tradle/react-native-http": "^2.0.1",
        "assert": "^1.5.0",
        "axios": "0.27.2",
        "base-64": "^1.0.0",
        "browserify-zlib": "^0.1.4",
        "buffer": "^4.9.2",
        "console-browserify": "^1.2.0",
        "constants-browserify": "^1.0.0",
        "crypto-js": "^4.1.1",
        "dns.js": "^1.0.1",
        "domain-browser": "^1.2.0",
        "ethers": "^5.5.2",
        "events": "^1.1.1",
        "https-browserify": "^0.0.1",
        "lodash.capitalize": "^4.2.1",
        "lodash.find": "^4.6.0",
        "lodash.isempty": "^4.4.0",
        "moti": "^0.20.0",
        "node-libs-browser": "^2.2.1",
        "path-browserify": "^0.0.0",
        "process": "^0.11.10",
        "prop-types": "^15.7.2",
        "punycode": "^1.4.1",
        "querystring-es3": "^0.2.1",
        "react": "17.0.2",
        "react-native": "0.67.5",
        "react-native-app-intro-slider": "^4.0.4",
        "react-native-bouncy-checkbox": "^3.0.2",
        "react-native-checkbox-reanimated": "^0.1.0",
        "react-native-code-push": "^7.0.4",
        "react-native-crypto": "^2.2.0",
        "react-native-device-info": "^10.0.2",
        "react-native-fast-image": "^8.5.11",
        "react-native-file-access": "^2.5.0",
        "react-native-flipper": "0.125.0",
        "react-native-gesture-handler": "2.9.0",
        "react-native-haptic-feedback": "^1.14.0",
        "react-native-inappbrowser-reborn": "^3.7.0",
        "react-native-keyboard-aware-scroll-view": "^0.9.5",
        "react-native-level-fs": "^3.0.1",
        "react-native-linear-gradient": "^2.6.2",
        "react-native-material-menu": "^2.0.0",
        "react-native-mmkv": "2.1.0",
        "react-native-modal": "^13.0.1",
        "react-native-os": "^1.2.6",
        "react-native-permissions": "^3.6.1",
        "react-native-popover-view": "^4.1.0",
        "react-native-quick-base64": "^2.0.5",
        "react-native-randombytes": "^3.6.1",
        "react-native-razorpay": "^2.3.0",
        "react-native-reanimated": "2.8.0",
        "react-native-rename": "^3.2.12",
        "react-native-responsive-fontsize": "^0.5.1",
        "react-native-safe-area-context": "^3.3.2",
        "react-native-screens": "3.9.0",
        "react-native-share": "^7.9.0",
        "react-native-snap-carousel": "^4.0.0-beta.6",
        "react-native-sound": "^0.11.2",
        "react-native-status-bar-height": "^2.6.0",
        "react-native-svg": "^12.1.1",
        "react-native-tcp-socket": "^6.0.2",
        "react-native-toast-message": "^2.1.5",
        "react-native-udp": "^4.1.7",
        "react-native-webview": "^11.26.0",
        "react-redux": "^8.0.2",
        "react-timer-hook": "^3.0.5",
        "readable-stream": "^1.0.33",
        "redux": "^4.2.0",
        "redux-flipper": "^2.0.0",
        "redux-persist": "^6.0.0",
        "stream-browserify": "^3.0.0",
        "string_decoder": "^0.10.31",
        "timers-browserify": "^1.4.2",
        "tty-browserify": "^0.0.0",
        "url": "^0.10.3",
        "util": "^0.10.4",
        "vm-browserify": "^0.0.4",
        "web3": "^1.6.1",
        "zustand": "^4.1.3"
    },
    "devDependencies": {
        "@babel/core": "^7.12.9",
        "@babel/plugin-transform-react-jsx": "^7.14.9",
        "@babel/runtime": "^7.15.4",
        "@react-native-community/eslint-config": "^2.0.0",
        "@types/crypto-js": "^4.1.1",
        "@types/fbemitter": "^2.0.32",
        "@types/lodash.capitalize": "^4.2.7",
        "@types/lodash.find": "^4.6.7",
        "@types/lodash.isempty": "^4.4.7",
        "@types/node": "^16.11.6",
        "@types/react": "17.0.18",
        "@types/react-native": "^0.66.11",
        "@types/react-native-razorpay": "^2.2.0",
        "@types/react-native-snap-carousel": "^3.8.5",
        "@types/react-redux": "^7.1.18",
        "@types/react-test-renderer": "^17.0.1",
        "babel-jest": "^26.6.3",
        "babel-plugin-module-resolver": "^4.0.0",
        "eslint": "^7.22.0",
        "eslint-config-prettier": "^8.3.0",
        "eslint-import-resolver-babel-module": "^5.1.2",
        "eslint-plugin-import": "^2.24.2",
        "eslint-plugin-jest": "^24.3.5",
        "eslint-plugin-prettier": "^4.0.0",
        "eslint-plugin-react": "^7.26.1",
        "eslint-plugin-simple-import-sort": "^7.0.0",
        "husky": "^7.0.0",
        "identity-obj-proxy": "^3.0.0",
        "jest": "^26.6.3",
        "lint-staged": ">=10",
        "metro-react-native-babel-preset": "^0.66.2",
        "patch-package": "^6.4.7",
        "prettier": "^2.4.1",
        "react-native-clean-project": "^4.0.1",
        "react-native-mmkv-flipper-plugin": "^1.0.0",
        "react-native-svg-transformer": "^1.0.0",
        "react-query-native-devtools": "^4.0.0",
        "react-test-renderer": "17.0.2",
        "rn-nodeify": "^10.3.0",
        "typescript": "^4.4.3"
    },

Here is the screen shot from xcode

Screen Shot 2023-08-03 at 07 44 44 AM

I am facing this issue for several day's , but 3month earlier I was't getting this type of issue

React Native Version

0.67.5

Output of npx react-native info

System: OS: macOS 13.4.1 CPU: (8) arm64 Apple M1 Pro Memory: 85.23 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.17.0 - /opt/homebrew/opt/node@18/bin/node Yarn: 3.6.1 - ~/node_modules/.bin/yarn npm: 9.6.7 - /opt/homebrew/opt/node@18/bin/npm Watchman: 2023.07.24.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.12.1 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: API Levels: 23, 29, 30, 31, 32, 33 Build Tools: 29.0.0, 29.0.1, 29.0.2, 29.0.3, 30.0.0, 30.0.1, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0 System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs ARM 64 v8a, android-29 | Google APIs Intel x86 Atom, android-30 | Intel x86 Atom_64, android-30 | Google APIs ARM 64 v8a, android-30 | Google APIs Intel x86 Atom, android-31 | Intel x86 Atom_64, android-32 | Google APIs ARM 64 v8a, android-32 | Google APIs Intel x86 Atom_64, android-32 | Google Play ARM 64 v8a, android-32 | Google Play Intel x86 Atom_64, android-33 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8139111 Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild Languages: Java: 11.0.20 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.5 => 0.67.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

react-native run-ios is working after I have added export NODE_OPTIONS=--openssl-legacy-provider in ~/.bashrc and ~/.zshrc.

But Xcode=>Product=>[Build / Archive / Analyze] showing above error. Screen Shot 2023-08-03 at 07 44 44 AM

Snack, screenshot, or link to a repository

Screen Shot 2023-08-03 at 07 44 44 AM

and it's private project can share more details..

github-actions[bot] commented 1 year ago
:warning: Too Old Version of React Native
:information_source: It looks like your issue or the example you provided uses a Too Old Version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
github-actions[bot] commented 1 year ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
MursiDirect commented 10 months ago

any fix for this issue? same issue here @techamit95ch

patmisch commented 10 months ago

You need to apply the same export NODE_OPTIONS=--openssl-legacy-provider that fixed react-native run-ios to the Xcode shell. You can add this to the "Bundle react native code and images" section under the Build Phases tab.

MursiDirect commented 10 months ago

@patmisch Thanks is not enough, you really saved my day, working like a charm