IrishGringo
IrishGringo

Reputation: 4044

Firebase serve does not update Service Worker

When I do a firebase init at command line, and create a standard web page, then a firebase serve, then open http://localhost:5000. I usually get a web page that I was working on at previous time. I am almost certain this is from a previous version of serviceworker.js.

Also depends on which browser I am using on my Mac (Safari, Chrome, Firefox and Opera), they will get different results. My feeling is that there should be a ServiceWorker.js clear or reset command so that a new serviceworker.js will be created. So Question, is there a SW reset command someplace. Ideally at the command line?

Or am I just nuts?

Upvotes: 2

Views: 1642

Answers (1)

Michael Bleigh
Michael Bleigh

Reputation: 26333

Since the Service Worker registration lives entirely within the browser, there's no way for the firebase serve command to know that you've made changes.

To clear all local stored data including Service Worker registrations (for Chrome at least), you can open the web inspector, go to the "Application" tab, and click the "Clear site data" button. Safari does not yet support Service Worker, so you shouldn't see the same behavior there.

If you're working on multiple web apps at the same time, you might want to consider using different ports for each, e.g. firebase serve -p 5001 for a second app.

Upvotes: 2

Related Questions