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

Cannot build: digital envelope routines::unsupported #65

Open
rweichler opened this issue Nov 1, 2024 · 2 comments
Open

Cannot build: digital envelope routines::unsupported #65

rweichler opened this issue Nov 1, 2024 · 2 comments

Comments

@rweichler
Copy link

rweichler commented Nov 1, 2024

Tried this on FreeBSD (arm64) and macOS (arm64)

I googled "digital envelope routines" unsupported and found this stackoverflow post which suggests this is because of some recent security concern

$ webpack-cli build
node:internal/crypto/hash:79
  this[kHandle] = new _Hash(algorithm, xofLen, algorithmId, getHashCache());
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at module.exports (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/util/createHash.js:90:53)
    at Compilation.createHash (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/Compilation.js:2272:16)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/Compilation.js:1286:9
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.seal (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/Compilation.js:1242:27)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/Compiler.js:546:17
    at eval (eval at create (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:11:1)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/Compilation.js:1093:12
    at errorAndCallback (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/Compilation.js:945:6)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/Compilation.js:978:14
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/NormalModuleFactory.js:397:22
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/NormalModuleFactory.js:130:21
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/NormalModuleFactory.js:224:22
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/neo-async/async.js:2825:7
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/neo-async/async.js:6886:13
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/webpack/lib/NormalModuleFactory.js:214:25
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/Resolver.js:184:12
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/Resolver.js:238:5
    at eval (eval at create (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:37:5
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/Resolver.js:238:5
    at eval (eval at create (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/Resolver.js:238:5
    at eval (eval at create (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:12:1)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:42:38
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/Resolver.js:238:5
    at eval (eval at create (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:48:1)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js:23:37
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/Resolver.js:238:5
    at eval (eval at create (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/Resolver.js:238:5
    at eval (eval at create (/Users/reed/code/gh/fengari-lua/fengari-web/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
    at /Users/reed/code/gh/fengari-lua/fengari-web/node_modules/enhanced-resolve/lib/forEachBail.js:30:14 {
  opensslErrorStack: [
    'error:03000086:digital envelope routines::initialization error',
    'error:0308010C:digital envelope routines::unsupported'
  ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v22.8.0
@rweichler rweichler changed the title Cannot build: digital envelope routines unsupported Cannot build: digital envelope routines unsupported Nov 1, 2024
@rweichler rweichler changed the title Cannot build: digital envelope routines unsupported Cannot build: digital envelope routines::unsupported Nov 1, 2024
@rweichler
Copy link
Author

Workaround:

NODE_OPTIONS=--openssl-legacy-provider yarn install

@rweichler
Copy link
Author

rweichler commented Nov 6, 2024

I did some digging and found this stackoverflow post which seems to indicate that webpack was using md4 for hashing (i assume this is for incremental builds) and apparently they decided it was insecure so they deprecated it. I would be tempted to switch off of webpack.... maybe to esbuild or something like this:

let Dependency = (function() {
#include "dependency.js"
})();
console.log('hello world');
gcc -E -x c -P in.js > out.js

Just my 2¢. I bring this up because it doesnt seem like you have many dependencies and are mainly using webpack to combine everything into a single script. Plus, it would resemble the original Lua source a bit more haha.

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