Skip to main content

Featured post

How to Insert line break in Text component in React Native

Hi, I was developing an application in react native.I have to handle lots of text data in this small react native application.I have used  Text component in react native many times. While working on this application,i had a requirement to display some text content with line breaks.I will explain it clearly with an example.I want to display a text as shown below  Welcome Please subscribe my channel I wrote react native code as shown below <View> <Text> Welcome Please subscribe my channel </Text> <View> When i run these lines of code,It will display text as shown below Welcome Please subscribe my channel   - instead of displaying in two lines with line break,it displays in a single line.So i have to find a solution to insert line break in Text component in React Native.After lots of research,i found a clean solution as shown below <View> <Text> Welcome{"\n"} Please subscribe my channel </Text> <View> Here ...

Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported fixed

Hi,




Today i will explain how to fix an error Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported.I got this error when i was working in a react native project.My project was in react native version 0.64.2 .When i run the command 

npm start 

i got the error as shown below


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 (D:\Trivia\FrontEnd\node_modules\metro-cache\src\stableHash.js:19:8)

    at Object.getCacheKey (D:\Trivia\FrontEnd\node_modules\metro-transform-worker\src\index.js:647:7)

    at getTransformCacheKey (D:\Trivia\FrontEnd\node_modules\metro\src\DeltaBundler\getTransformCacheKey.js:32:19)        

    at new Transformer (D:\Trivia\FrontEnd\node_modules\metro\src\DeltaBundler\Transformer.js:180:28)

    at D:\Trivia\FrontEnd\node_modules\metro\src\Bundler.js:58: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'

}


How to fix Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported by downgrading node version





When i checked my system i found that i have installed different node versions.I will list them down.


    19.6.0

  * 18.14.0 (Currently using 64-bit executable)

    17.0.1

    14.18.1


Out of above four versions,as mentioned above  18.14.0 is currently using.From node 17  onwards,there is  critical breaking changes.If i am using node 18.14.0 and running a react native project with old react native version 0.64.2 may leads to error.

So i fixed the error by downgrading my node version from 18.14.0 to 14.18.1. After downgrading error i could execute the command npm start sucessfully


How to fix Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported by the command  set NODE_OPTIONS=--openssl-legacy-provider 




If first option doesn't work or you are not willing to downgrade node version,then go with set NODE_OPTIONS=--openssl-legacy-provider command.Once you executed set NODE_OPTIONS=--openssl-legacy-provider command,then execute npm start ,your projct will work without any error


Thanks