0

Got "Call retries were exceeded" error when i got to dynamic slug page, as per the discussion github i downgraded my project from 13 to 12 version, but still getting same issue. let me share my error screenshot first then i will share my code too.

enter image description here

slug.js

    export const getStaticPaths = async () => {

  const res = await axios(process.env.NEXT_PUBLIC_API_URL+'/products');
  const products_arr = await res.data;
  const paths = products_arr.map( (pr) => ({
   params: { slug: pr.slug }
  }))

  return {
    paths,
    fallback: "blocking",
  };
}

export const getStaticProps = async ({params}) => {

  try {
    const res = await axios(`${process.env.NEXT_PUBLIC_API_URL}/products/${params.slug}`);
    const product = await res.data;
    return {
      props: { product }
    }
  } catch (error) {
      console.error(error);
      return { notFound: true };
  }

}

package.json

{
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "postinstall": "patch-package"
  },
  "dependencies": {
    "@tailwindcss/typography": "^0.5.9",
    "axios": "^1.3.4",
    "flowbite": "^1.6.3",
    "flowbite-react": "^0.4.1",
    "next": "12.2.2",
    "next-themes": "^0.2.1",
    "patch-package": "^7.0.0",
    "pure-react-carousel": "^1.30.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-icons": "^4.7.1",
    "swiper": "^8.4.5",
    "swr": "^2.1.0"
  },
  "devDependencies": {
    "@types/node": "20.2.5",
    "@types/react": "18.2.7",
    "autoprefixer": "^10.4.12",
    "postcss": "^8.4.18",
    "tailwindcss": "^3.2.4",
    "typescript": "4.9.4"
  }
}
Yilmaz
  • 35,338
  • 10
  • 157
  • 202
shazim ali
  • 360
  • 4
  • 18

0 Answers0