Digital envelope routines:unsupported

Hello,

I am experiencing issues while Run ‘npx frontity dev’

Some common errors: https://i.imgur.com/hhovIcq.png

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node: internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:\Users\Amjad\Desktop\HeadlessWP\wpminds-headless\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\Amjad\Desktop\HeadlessWP\wpminds-headless\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\Users\Amjad\Desktop\HeadlessWP\wpminds-headless\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\Users\Amjad\Desktop\HeadlessWP\wpminds-headless\node_modules\webpack\lib\NormalModule.js:503:5
at C:\Users\Amjad\Desktop\HeadlessWP\wpminds-headless\node_modules\webpack\lib\NormalModule.js:358:12
at C:\Users\Amjad\Desktop\HeadlessWP\wpminds-headless\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\Amjad\Desktop\HeadlessWP\wpminds-headless\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (C:\Users\Amjad\Desktop\HeadlessWP\wpminds-headless\node_modules\loader-runner\lib\LoaderRunner.js:221:10)

I try ‘npx frontity dev --port 4000’

I have been struggling with this issue for several days and would greatly appreciate any help or suggestions.

Thank you.

A terrible fix, but something that you can do for now - downgrade to node 16. (use NVM for instance)

In node 17 they deprecated the openssl standard that is used by webpack in one of the frontity dependencies. I am looking at creating a better fix, as frontity won’t deploy on vercel until it’s fixed :smiley:

/Frederik

I tried downgrade and doesn’t work. I’ve been trying three days now.

Another terrible advice, would be to allow openssl legacy providers on your machine:

If you’re on mac / linux

export NODE_OPTIONS=--openssl-legacy-provider

If you’re on windows:

set NODE_OPTIONS=--openssl-legacy-provider

/Frederik

Now said:

–openssl-legacy-provider is not allowed in NODE_OPTIONS
Could not determine Node.js install directory

It won’t work with node 16, you have to use node 18 and have it set. So the solution I suggested was EITHER node 16 OR setting the NODE_OPTIONS. You can run:

unset NODE_OPTIONS

To fix it

I didn’t know how to run this unset NODE_OPTIONS on vercel

But this solution works for me:

Add or edit .npmrc file in your project folder and add the option:

node-options="--openssl-legacy-provider"

It’s working and resolved the issue.
Thanks