problem with static props
Unanswered
Chinese Alligator posted this in #help-forum
Chinese AlligatorOP
Hello i have a problem with getstaticprops in my code. I think its problem in change pages/index.tsx to app/page.tsx. App/page not supported getstaticprops and thats my problem. I dont know how repare my code.
I have this error:
./app/page.tsx
ReactServerComponentsError:
"getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching
╭─[/Users/tomastomanec/Desktop/portfolio-v2/portfolio-website/app/page.tsx:67:1]
67 │ );
68 │ }
69 │
70 │ export async function getStaticProps() {
· ──────────────
71 │ const httpLink = createHttpLink({
72 │ uri: 'https://api.github.com/graphql',
73 │ });
╰────
File path:
./app/page.tsx
I have this error:
./app/page.tsx
ReactServerComponentsError:
"getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching
╭─[/Users/tomastomanec/Desktop/portfolio-v2/portfolio-website/app/page.tsx:67:1]
67 │ );
68 │ }
69 │
70 │ export async function getStaticProps() {
· ──────────────
71 │ const httpLink = createHttpLink({
72 │ uri: 'https://api.github.com/graphql',
73 │ });
╰────
File path:
./app/page.tsx
4 Replies
Chinese AlligatorOP
my code here
Asian black bear
Reading the error explains the error:
"getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching
@Asian black bear Reading the error explains the error:
> "getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching
Chinese AlligatorOP
And you can give me idea what is supported?