Cannot export const revalidate in server component #49769
-
|
I'm having this error in appDir with v13.4.2 'use server';
export const revalidate = 60;
export default async function Test () {
return <></>
}Error: Only occurs with the 'use client' directive. But anyway caching is not happening. |
Beta Was this translation helpful? Give feedback.
Answered by
fuma-nama
May 14, 2023
Replies: 1 comment 1 reply
-
|
The By default, Pages are considered as a server component, you don't have to specify |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
anarkrypto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
"use server"is used for server actions only, it expects you to export an async function.By default, Pages are considered as a server component, you don't have to specify
use serverat the top of the file