How can I determine what line is causing a 404 err

2019-09-19 13:05发布

问题:

I have a terrible repeating error of 404 not found for a GET request.

The call looks like this in the JavaScript console

GET some_path/undefined 404 ( Not Found )

and all it states to the right of that is:

undefined:1

It keeps repeating over and over, it does not stop. How can I determine what line is trying to make this call?

回答1:

On chrome you can add breakpoints on XHR and then you should see the callstack. Go to developer tools -> "sources" tab -> "XHR Breakpoints" and add a breakpoint filtered by the relevant URL