Next.js Discord

Discord Forum

Question about Error.js boundry (NEXTJS 13)

Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
Hello guys.
I am trying to fetch my medium articles into my new app.

I have the following request in my component.
I am trying to create the error.js component.

To test, i changed the url to a faulty one like so:

//Articles.tsx which is imported in Page.tsx
  const mediumData: MediumType = await axios
    .then((res) => {
      if ( {
      throw new Error("Failed to fetch data");

the error boundary shows after a while, but the API keeps fetching in a loop (view image)

is there a way to stop the API fetch after one error?

0 Replies