When fetching data, sometimes, my app will return the html for the debug toolbar. What makes this quite bizarre, is that it does NOT happen every time. I had to refresh the page 7 times for it to happen. In some cases it does it all the time.
When I turn off the profiler, there is no problem fetching the data.
I tried to switch to jQuery ajax, but I got the same type of results.
I am using the symfony server, symfony 4.2, php7.2, webpack encore, React js.
If I use postman to connect to the api, then I have no failures. Only from the web page doing ajax.
I stripped down to putting the js code directly into the twig file to bypass Webpack.
I am looking for suggestions on how to troubleshoot this.
Thank you very much.
UPDATE:
I checked the logs and it looks like the matched route is wrong.
Jul 17 15:44:48 SERVER GET (200) /api/map-point/list/quick/26.190096/-80.365865
Jul 17 15:44:48 REQUES Matched route "_wdt". method="GET" request_uri="https://127.0.0.1:8000/_wdt/3de748