1

I got a React environment and the app works when in Chrome but not in Safari or Brave.

The console error Brave gives is this:

Uncaught ReferenceError: globalThis is not defined
    at Object.<anonymous> (byte-utils.js:5)

And the line 5 in reference is this:

const useBuffer = globalThis.process && !globalThis.process.browser && globalThis.Buffer && typeof globalThis.Buffer.isBuffer === 'function';

Any ideas?

MistaPrime
  • 1,591
  • 1
  • 10
  • 20

1 Answers1

1

It sounds like Brave and older versions of Safari don't support it - it's a somewhat new object, after all.

You can either include a polyfill or simply reference window instead of globalThis - the global object in a browser is the window (except in workers, where you need to use self instead of window).

CertainPerformance
  • 356,069
  • 52
  • 309
  • 320