Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Why are my forced GET errors occurring twice instead of once in the browser?

Is this expected? I am testing the error checking of my code by forcing a GET error. That is, I turned off the endpoints on purpose. Oddly I am getting two errors for each single error.

I verified my fetch() request only occurs once by logging it to the console.

However I see two errors in the console. I wanted to make sure that for some reason the browser is not fetching the data twice.

Is this expected behavior? If so where is it documented?

GET http://localhost:3000/users/user 404 (Not Found)

It occurs twice for a single fetch();

Here is the fetch()

const options = {
  credentials: 'include'
};
fetch('/users/user', options)
  .then((response) => {
    return response.json();
  })
  .then((user) => {
    if(user) {
      dispatch({type: 'initializeUser', current: user});
    }
  })
  .catch((err) => {
    console.error('DEBUG: F1Data: /users/user endpoint failed : ', err);
  })

Similarly, I see my own error being thrown twice as well:

DEBUG: F1Data: /users/user endpoint failed :  SyntaxError: Unexpected token < in JSON at position 0
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!