Screenshot for Error: Can't resolve 'process/browser':
I'm hoping someone could help me here. With the Webpack 5 breaking changes with polyfills I was able to use react-rewired to add fallbacks to a config-overrides.js
I npm installed every dependency I could, but I'm still getting this error for "process/browser". I'm not really sure how to identify the problem.
const webpack = require("webpack");
module.exports = function override(config) {
const fallback = config.resolve.fallback || {};
Object.assign(fallback, {
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
assert: require.resolve("assert"),
http: require.resolve("stream-http"),
https: require.resolve("https-browserify"),
os: require.resolve("os-browserify"),
url: require.resolve("url"),
zlib: require.resolve("browserify-zlib"),
fs: require.resolve("browserify-fs"),
process: require.resolve("process"),
buffer: require.resolve("buffer"),
net: require.resolve("net"),
});
config.resolve.fallback = fallback;
config.plugins = (config.plugins || []).concat([
new webpack.ProvidePlugin({
process: "process/browser",
Buffer: ["buffer", "Buffer"],
}),
]);
return config;
};
fallback: { "crypto": require.resolve("crypto-browserify"), "http": require.resolve("stream-http"), "fs": require.resolve("browserify-fs"), "assert": require.resolve("assert"), "os": require.resolve("os-browserify"), "async_hooks": false, "express": false, }, }
– Overcritical