I have react application where I am using msw to mock my server responses. I am doing everything to set up server and passing correct handlers.
Earlier this was working fine. Suddenly all my mock requests are failing on my machine. This is working on one of my friends machine.
We checked and we are using the same node version.
rest.get(`http://localhost:3000/api/users`, (req, res, ctx) => {
const mockApiResponse = [{id: 1,name: "Test",add: "xyz"}];
return res(ctx.json(mockApiResponse));
})
Suddenly all requests failing and we are getting "FETCH ERROR", "Network request failed" error on console. We tried logging request in component and it says status as 'rejected'.
In live browser requests are working fine.
Anyone have any suggestions?