Build failed - Error: error:0308010C:digital envelope routines::unsupported
Hi there, I cannot get past this error which I have been trying to fix for weeks now. I am running a rails 7 app here with node+webpack.
It seems that its an issue with webpack causing this: https://github.com/webpack/webpack/issues/14532
I have tried updating webpack locally and setting the new versions in the package.json to try to skip this error, but nothing works. I am wondering how I can set something like 'export NODE_OPTIONS=--openssl-legacy-provider' in Railway?
Here's the error output I am receiving upon deployment.
output:
Error: error:0308010C:digital envelope routines::unsupported
GitHub
nodejs 17: digital envelope routines::unsupported · Issue #14532 · ...
Bug report What is the current behavior? [webpack-cli] Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (node:crypto:1...
9 Replies
Project ID:
5a86d44d-3c28-4634-8940-766d17fcedea
You might find these helpful:
- Host key verification failed error msg
- Application error hosting Express server
- Does anyone know how to select a nodejs version?
⚠️ experimental feature
5a86d44d-3c28-4634-8940-766d17fcedea
Will take a look a bit later
Flagging this thread. A team member will be with you shortly.
You should be able to set
NODE_OPTIONS
to --openssl-legacy-provider
in the Variables tab.Or, you can downgrade to Node.js 16 using
engines
: https://docs.npmjs.com/cli/v6/configuring-npm/package-json#enginespackage.json | npm Docs
Specifics of npm's package.json handling
E.g.:
(not a team member, just a person who's seen this issue before)
Thanks for this.
Tried all of the above, no luck sadly.
In the end I removed Webpack.