Replies: 1 comment 4 replies
-
Hi, @rmiller61. Thanks for raising this. First things first, I highly recommend following the Debugging runbook whenever something is not intercepted when you think it should be. That should help you figure out if it's MSW's problem or something else. If you are certain that MSW is enabled server-side, can see some requests logged but not others, then I suspect the culprit is in the nature of those requests. MSW uses Interceptors to intercept requests in Node.js. It supports ClientRequest, XMLHttpRequest (abstraction over ClientRequest in JSDOM), and fetch. Perhaps Hydrogen is constructing a request by other means, like a raw Let me know if you find more details about this. |
Beta Was this translation helpful? Give feedback.
-
I have an issue with a Hydrogen app (Hydrogen is Shopify's headless/React framework, which uses Remix). I've implemented MSW as I would in any other Remix app, but with Hydrogen, MSW is not able to intercept anything inside a loader function. However, MSW is working, as evidenced by the messages logged to the console. For example, you can see that MSW picks up the requests Shopify sends to track performance/analytics.
It's specifically the requests inside the loader that MSW cannot intercept, and I'm wondering why. To be clear, I'm not looking for a solution per se (although one is always appreciated!). I've already opened an issue with Hydrogen, and I don't think it's MSW's responsibility to solve what appears to be a problem that's exclusive to their framework. Rather, I'd like to understand why this problem would exist at all, irrespective of whatever framework is being used. I have only a rudimentary understanding of how MSW actually works under the hood, so I'm not even sure how I should go about investigating this issue.
Beta Was this translation helpful? Give feedback.
All reactions