2

I'm working on a Chrome Extension in React that communicates with Firebase. My workflow: make some changes, run the build script, and then press the reload button on the chrome extensions developer card. Everything I change to the frontend shows right away, but changes to background.js are not being reflected in the files that the extension is serving.

I initially have been trying to add new fields to my firebase collections by adding key/value pairs being sent with the updateDoc() method. I thought there was an issue with firebase until I checked an error through the console by clicking the link to the rendered background.js file and did not see any of my changes. Then I tried putting more console logs in the file, including at the beginning of the file, directly under another console log that is printing, and none of the new logs are printing.

Is there an issue with the backgound.js file being stored in cache, preventing me from updating similar to working with PWA version control?

Thank you

gibstock
  • 31
  • 2

1 Answers1

-1

The chrome shuts down the background script when it isn't in use and when you need the background script again it loads firebase from scratch and inside this load it checks the tokens and in this time firebase returns null for the current user. added some more logic for fixing this.
You can try to look and set the service worker which clears cache based on versions, and then try if it works,check the this quick ReadMe for firebase quickstart guide on chromeextension and this useful thread on Firebase and Chrome extension
Also check these following links for similar example implementations:

Vaidehi Jamankar
  • 1,232
  • 1
  • 2
  • 10