From 0c1819bb15d2540c153a39c7d5c495a43dfad794 Mon Sep 17 00:00:00 2001 From: timvisee Date: Tue, 4 Feb 2025 20:07:33 +0100 Subject: [PATCH] Fix build failure due to crypto when using Node 18 or higher --- webpack.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index 83d469a8..aae4b99b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,6 +6,13 @@ const VersionPlugin = require('./build/version_plugin'); const AndroidIndexPlugin = require('./build/android_index_plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); +// Fix for node 18+ +// See: +const crypto = require('crypto'); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => + crypto_orig_createHash(algorithm == 'md4' ? 'sha256' : algorithm); + const webJsOptions = { babelrc: false, presets: [