generateRandomString is currently implemented using a polyfill of the Node.js crypto library, but Webpack 5 no longer includes this polyfill by default.
We could configure the polyfill manually, but instead I figured we could save some bundle size and just reimplement this using the browser-native crypto module, which has a getRandomValues function.