Missing globals in browser environment

When trying to run the WebRTC SDK in the browser (Chrome 91) we hit issues where the package was looking for global variables that would only exist in a NodeJS environment (process and Buffer).

To fix this, we added the following to our webpack config:

new webpack.ProvidePlugin({
  Buffer: ["buffer", "Buffer"],
}),
new webpack.DefinePlugin({
  process: {
    browser: true,
    nextTick: () => null,
  },
}),

We also needed to install the stanza package.

Is there a better solution for this that doesn't involve polyfilling?

SDK version: 6.0.1

I also created this same issue on your GH repo, not sure the best avenue for reporting these issues: https://github.com/MyPureCloud/genesys-cloud-webrtc-sdk/issues/576

Will respond on github.

This topic was automatically closed after 30 days. New replies are no longer allowed.