Javascript Google Auth Error redirect_uri: storagerelay://blob/?id=

I am trying to get Google Auth working. The Auth is being called from an IFrame embedded on a website. The code looks as such:

const client = google.accounts.oauth2.initCodeClient({
    client_id: 'xxxxxx',
    scope: 'https://www.googleapis.com/auth/calendar.readonly',
    ux_mode: 'popup',
    callback: (response) => {
    
  },
});

function signIn() {
    client.requestCode();
}

With the html being very simple:

<a class="btn btn-primary" onclick="signIn()"><i class="fab fa-google"></i> Sign-In With Google</a>

When the button is clicked, the following is returned.

enter image description here

What could be causing this the storage issue?