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
On my side, I had the same issue, but I realized that once I need to reload my extension so that it can update its service worker, I had to exit out of the tabs that are running the extension first before doing so.
I didn't have to do this before, but for some reason this is how it worked on myside.
I don't have a source that says that what I just said is correct or not, but this is just out of experience, I would be happy to know if doing this worked for you too.
My guess is that it's because the service worker is inactive when the extension is not being used, therefore that's the only time you can reload it. Again I have no proof other than experience.