Root cause:
It seems there's a race condition with the onload event being fired and the API call being made. In https://github.com/valendres/playwright-msw/pull/47, a change was made so that playwright-msw would not attempt to intercept API calls until this event was fired, with the goal of preventing the interception of the initial HTTP call (the one that should return HTML). While this seemed to solve the issue in React, it likely broke Vue compatibility 😞
Changes:
A minor change to the Router which utilises the first requestfinished event instead of load to detect page load.
Introduction of an example-vue app which ensures that this fix addresses the vue compatibility issue.
Fixes: https://github.com/valendres/playwright-msw/issues/60
Root cause: It seems there's a race condition with the onload event being fired and the API call being made. In https://github.com/valendres/playwright-msw/pull/47, a change was made so that playwright-msw would not attempt to intercept API calls until this event was fired, with the goal of preventing the interception of the initial HTTP call (the one that should return HTML). While this seemed to solve the issue in React, it likely broke Vue compatibility 😞
Changes:
requestfinished
event instead ofload
to detect page load.