Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork375
-
How would I go about debugging Service Workers? I've tried to find some ways to set workbox to be in debug mode, but I can't find anything that works. Thanks! |
BetaWas this translation helpful?Give feedback.
All reactions
To debug your service worker you need to use the flag--sw
when runningnpm run dev
In detail, you need to edit"dev": "preact watch --sw",
in yourpackage.json
Then every time you change your service worker you should stop the dev server and rerun it. For good measure you should also create a new Incognito session to view your page.
Replies: 2 comments 2 replies
-
Well that is the production-like output, not really what you'd want to use when debugging. Depending on what you're looking to debug, you can edit the |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thanks! I was missing something fundamental here, and ended up solving it by adding |
BetaWas this translation helpful?Give feedback.
All reactions
-
Ah, yep, should've mentioned that here. Sorry about that! Your answer is indeed the way to go. |
BetaWas this translation helpful?Give feedback.
All reactions
-
To debug your service worker you need to use the flag In detail, you need to edit Then every time you change your service worker you should stop the dev server and rerun it. For good measure you should also create a new Incognito session to view your page. |
BetaWas this translation helpful?Give feedback.