Axios requests stuck at pending

  Kiến thức lập trình

I have an app written in javascript with react.js framework, it uses react-query to fetch data with axios, but suddenly my requests hangs “pending” state

  • My back-end is written in laravel 11.x

  • for Chrome:

    • All of the requests hangs “pending” state, sometimes they fail with “ERR_ADDRESS_IN_USE” or “ERR_TIMED_OUT”
  • for Mozilla (Nightly):

    • Most of them was succeeding, some of them hangs pending at the beginning, then i am started to getting CORS same-policy error
    • Some of them fails as CORS failed or NS_ERROR_DOM_BAD_URI

node.js runs on : 127.0.0.1:3000
laravel runs on : 127.0.0.1:8000

Chrome developer console.

Firefox developer console.

Laravel config/cors.php file.

it was just fine like 2-3 days ago, tried to revert last commits but it didn’t seem to work.

My custom axios object.

  • Tried to improve server performance by working on with relationships.
  • Tried to change axios config
  • Setup “Laravel Telescope” in order to review requests & SQL queries.
    • Requests & Queries seems to work just fine.

New contributor

Murat Kaya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT