-
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! |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
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.
Thanks to #955 and #1594 for the pointers!