-1

why getStaticProps function not working. even inside a valid page.

this is folder structure with target file enter image description here

The console inside getStaticProps() does not print anything & the console inside Home() prints "undefined".

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
  • 2
    `getStaticProps` only works with `pages` router, it does not work with `app` router. Make sure you are reading the correct version of docs, in your case you need `app` docs: https://nextjs.org/docs/app/building-your-application/data-fetching – Danila Jul 14 '23 at 13:34

1 Answers1

0

getStaticProps() is not works with app directory. In app directory every every thing will be server-side rendering.

Kannu Mandora
  • 479
  • 2
  • 10