Next js error in console _next/data/QPTTgJmZl2jVsyHQ_IfQH/blog/post/21/.json

6k views Asked by At

I receive an error in the console in my Next.js site.

GET https://example.com/_next/data/QPTTgJmZl2jVsyHQ_IfQH/blog/post/21/.json net::ERR_ABORTED 404

I don't understand why it's happened. Maybe I'm using the router incorrectly?

my link code:

    <Link href="/blog/post/[id]" as={`/blog/post/${id}`}>

for fetch data for post i use getStaticPaths & getStaticProps.

My problem is similar to this one, but I have it only in production. I try to use prefetch but it did not work.

1

There are 1 answers

0
Luis Takahashi On BEST ANSWER

This error seems to be something related to the props your page need.

If you inspect the requests of a production build SSR or SSG page the initial pageProps returns from this endpoint: _next/data/....

So check your server console or add some debug helpers to understand deeply what is happening in your getServerSideProps or getStaticProps.

fyi