Response patching does not work with a request triggered by navigator.sendBeacon
.
ctx.fetch(req)
does not seem to bypass msw and triggers the same request over and over again, causing an infinite request loop.
- Check out the repro:
git clone https://github.com/hpohlmeyer/msw-send-beacon-loop.git
- Run
npm install
in the root folder - Run
npm start
- Go to http://localhost:3002/
- Open the network tab in the devtools
- Click on the "Trigger request" button
- You will see an infinite request loop