WalletConnect / modal

WalletConnectModal repository
https://lab-walletconnect-modal.pages.dev/
Apache License 2.0
18 stars 15 forks source link

2.6.0 Release polyfill guide #22

Open xzilja opened 1 year ago

xzilja commented 1 year ago

Summary

Summary

2.6.0 removed polyfills as per release notes in https://github.com/WalletConnect/modal/releases/tag/2.6.0

If you happen to use something that requires these (usually in our cdn bundles), you can reference our previous implementation to see how this is done below. Make sure to polyfill before you import modal packages.

import { Buffer } from 'buffer'

if (typeof window !== 'undefined') {
  if (!window.Buffer) {
    window.Buffer = Buffer
  }
  if (!window.global) {
    window.global = window
  }
  if (!window.process) {
    window.process = { env: {} }
  }
}