The Edge runtime neither has access to Buffer nor window. It does however has access to btoa directly. I'm using it in my NextJS middleware that runs on the Edge middleware If I change it like this it works fine for me. And I don't think it'll break any other scenario, right? ```diff - var btoa if (typeof Buffer === 'function') { btoa = btoaBuffer + } else if(typeof window !== 'undefined') { btoa = window.btoa.bind(window) } ```
The Edge runtime neither has access to Buffer nor window. It does however has access to btoa directly.
I'm using it in my NextJS middleware that runs on the Edge middleware
If I change it like this it works fine for me. And I don't think it'll break any other scenario, right?