e2e: Close pages before disabling MSW#13531
Conversation
Without this, requests still in flight (or fired by late-running hydration code) bypass the mocks once `worker.disable()` removes the interception and hit the real network instead, surfacing as `[404]` log lines from the SvelteKit `vite preview` web server.
|
@kettanaito is this something that should be mentioned in the MSW docs? (or maybe it already is, in that case apologies for the ping 😅) |
|
Hi, @Turbo87. We've already addressed that and the proper fix is coming in 3.0 as that requires a breaking change both in the In fact, could you please give this branch a try and see if your change is still necessary with it? Thanks. |
I tried the beta from We are using Our local fix is to close all context pages before calling |
|
damn... the change in the PR worked perfectly locally, but I've rebased #13373 on top of it and CI still shows leaked requests 😵💫 |
|
interestingly, removing the ... but locally it still shows the occasional leak 😵💫 |
|
We are in the process of updating |
|
yeah, no worries. it's not breaking anything here, just unintentionally leaking requests to the dev server. feel free to ping me once |
Without this, requests still in flight (or fired by late-running hydration code) bypass the mocks once
worker.disable()removes the interception and hit the real network instead, surfacing as[404]log lines from the SvelteKitvite previewweb server.