'Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?'
exportconstUNSTABLE_REVALIDATE_RENAME_ERROR=
'The `revalidate` property is not yet available for general use.\n'+
'To try the experimental implementation, please use `unstable_revalidate` instead.\n'+
"We're excited for you to try this feature—please share all feedback on the RFC:\n"+
'https://nextjs.link/issg'
'The `unstable_revalidate` property is available for general use.\n'+
'Please use `revalidate` instead.'
exportconstGSSP_COMPONENT_MEMBER_ERROR=`can not be attached to a page's component and must be exported from the page. See more info here: https://err.sh/next.js/gssp-component-member`
@@ -525,10 +525,10 @@ export async function renderToHTML(
}
constinvalidKeys=Object.keys(data).filter(
(key)=>key!=='unstable_revalidate'&&key!=='props'
(key)=>key!=='revalidate'&&key!=='props'
)
if(invalidKeys.includes('revalidate')){
if(invalidKeys.includes('unstable_revalidate')){
thrownewError(UNSTABLE_REVALIDATE_RENAME_ERROR)
}
...
...
@@ -546,41 +546,41 @@ export async function renderToHTML(
)
}
if(typeofdata.unstable_revalidate==='number'){
if(!Number.isInteger(data.unstable_revalidate)){
if(typeofdata.revalidate==='number'){
if(!Number.isInteger(data.revalidate)){
thrownewError(
`A page's revalidate option must be seconds expressed as a natural number. Mixed numbers, such as '${data.unstable_revalidate}', cannot be used.`+
`A page's revalidate option must be seconds expressed as a natural number. Mixed numbers, such as '${data.revalidate}', cannot be used.`+
`\nTry changing the value to '${Math.ceil(
data.unstable_revalidate
data.revalidate
)}' or using \`Math.ceil()\` if you're computing the value.`
)
}elseif(data.unstable_revalidate<=0){
}elseif(data.revalidate<=0){
thrownewError(
`A page's revalidate option can not be less than or equal to zero. A revalidate option of zero means to revalidate after _every_ request, and implies stale data cannot be tolerated.`+
`\n\nTo never revalidate, you can set revalidate to \`false\` (only ran once at build-time).`+
`\nTo revalidate as soon as possible, you can set the value to \`1\`.`
)
}elseif(data.unstable_revalidate>31536000){
}elseif(data.revalidate>31536000){
// if it's greater than a year for some reason error
console.warn(
`Warning: A page's revalidate option was set to more than a year. This may have been done in error.`+
`\nTo only run getStaticProps at build-time and not revalidate at runtime, you can set \`revalidate\` to \`false\`!`
)
}
}elseif(data.unstable_revalidate===true){
}elseif(data.revalidate===true){
// When enabled, revalidate after 1 second. This value is optimal for
// the most up-to-date page possible, but without a 1-to-1