diff --git a/web/cashtab-v2/config/webpack.config.js b/web/cashtab-v2/config/webpack.config.js --- a/web/cashtab-v2/config/webpack.config.js +++ b/web/cashtab-v2/config/webpack.config.js @@ -1,5 +1,3 @@ -'use strict'; - const fs = require('fs'); const path = require('path'); const webpack = require('webpack'); @@ -300,6 +298,11 @@ ], }, resolve: { + fallback: { + stream: require.resolve('stream-browserify'), + crypto: require.resolve('crypto-browserify'), + buffer: require.resolve('buffer'), + }, // This allows you to set a fallback for where webpack should look for modules. // We placed these paths second because we want `node_modules` to "win" // if there are any conflicts. This matches Node resolution mechanism. @@ -581,6 +584,11 @@ ].filter(Boolean), }, plugins: [ + // Work around for Buffer is undefined: + // https://github.com/webpack/changelog-v5/issues/10 + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + }), // Generates an `index.html` file with the