#Using getStaticProps
12 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in <id:customize>
✅ You can mark a message as the answer for your post with `Right click -> Apps -> Mark Solution`
(if you don't see the option, try refreshing Discord with Ctrl + R)
Are you using the app router
Because the code looks correct if it is in the pages router
what do you meant the app router? im using it inside a page.jsx inside the app folder
Yes then you are using the app router
Then you dont have getStaticProps
@rain lotus maybe try learning with the page router first as it is what most people are using
i'm sorry i'm a bit new to next.js can you please send the link of the documentation of what you referring ? my end goal is to build a component at the server side using data from a json file
Sure no problem, if you take a look at the NextJs docs , top left you can see a button that switches between the page router and the newly added app router , here's what you are looking for : https://nextjs.org/docs/pages/building-your-application/data-fetching/get-static-props