Basically I stumbled upon this issue:
inspect-js/typed-array-byte-offset#2
Some implementations like Uint8Array.prototype.toBase64 depends on your npm library typed-array-byte-offset. It crashes in the browsers because there are references to variable name global that is only meaningful in Node.js, not in browsers.
From the above issue being closed as not planned, can I say that the library is not browser-safe? And from the readme of this library, one usage of this library is to fix Safari's incorrect behavior. To allow using this library to polyfill all provided functions in browsers (hopefully without bundlers), I suggest inlining the code from that library into this and changing global to globalThis.