Add a debugging request handler
See original GitHub issueIs your feature request related to a problem? Please describe.
One of the most common issues developers experience is unmatched requests.
Describe the solution you’d like
I suggest to add a debugger request handler (i.e. log
) that would act as a transparent handler, meaning it would log out any requests that didn’t match preceding handlers.
Describe alternatives you’ve considered We usually suggest to do that manually, but neither of the existing handlers can be fully used as a transparent request handler, as they have a predicate built-in which limits requests captured to a certain degree.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Debugging uncaught requests - Recipes - Mock Service Worker
Debugging uncaught requests · Enable onUnhandledRequest option · Examine the handlers · Verify the worker's scope · Run in debug mode.
Read more >Debugging a HTTP Handler from Visual Studio - Stack Overflow
Publish the handler to its own IIS application and then attach Visual Studio to IIS and you're ready to debug.
Read more >Debugging a HTTP Handler - MSDN - Microsoft
I start my Web Application using any random page in Visual Studio Debug. I then maually edit the URL to point to the...
Read more >How do I debug a http handler? - CodeProject
You can debug it just like any other piece of code. Put a break point in the handler run in debug. I've written...
Read more >Advanced Features: Debugging - Next.js
Once the server starts, open a new tab in Chrome and visit chrome://inspect , where you should see your Next.js application inside the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe there are multiple strategies the users may be choosing when installing MSW:
From the use-cases, I see the default
onUnhandledRequest
option would be beneficial to most of them. That being said, it’d be nice to see how many people follow each of those strategies to evaluate our choice.The fact that misconfigured request URLs cause 80% of mismatch issuses is a huge reason to set
onUnhandledRequest: "warn"
. That’d be both non-invasive, but informative.What about the mock-driven development? Although unexplored, I find it a promising direction and can see people developing against MSW until their backends are ready. Wouldn’t seeing a bunch of warnings be annoying?
I do share the idea to set “warn” as the default unhandled request policy, it’d ease the debugging curve for people experiencing uncaught requests. I just wish for us to think through all the implications of that change.