window undefined on background script when trying to login via firebase

I'm using React + Firebase.
I have a hook that handles user details and a background script that handles the auth via chrome.identity.getAuthToken
after I approve the consent screen, the background script throws "window is not defined" any ideas?
I followed this link - https://www.plasmo.com/blog/posts/firebase-chrome-extension
Diving deep into everything you need to make Firebase Auth work with your MV3 Chrome Extension
Firebase Authentication with React in an MV3 Chrome Extension
Was this page helpful?