Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported (Node.js 17+) #1879

Open
friederbluemle opened this issue Mar 2, 2023 · 0 comments

Comments

@friederbluemle
Copy link
Member

When using Node.js 17+, multiple React Native related commands will fail with the following error:

✖ 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:133:10)
✖     at stableHash (/tmpdir/node_modules/metro-cache/src/stableHash.js:19:8)
✖     at Object.getCacheKey (/tmpdir/node_modules/metro-transform-worker/src/index.js:593:7)
✖     at getTransformCacheKey (/tmpdir/node_modules/metro/src/DeltaBundler/getTransformCacheKey.js:24:19)
✖     at new Transformer (/tmpdir/node_modules/metro/src/DeltaBundler/Transformer.js:48:9)
✖     at /tmpdir/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').

This is due to a change in Node.js, and the fact that we still rely on the react-native-cli.
https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

The longer term fix is to remove the dependency on react-native-cli.

The short term workaround is to set this environment variable:

export NODE_OPTIONS=--openssl-legacy-provider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant