Unverified Commit 1affa75a authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update error check in validateRevalidate (#59826)

Applies
https://github.com/vercel/next.js/pull/59822#discussion_r1433267299

Closes NEXT-1916

---------
Co-authored-by: 's avatarZack Tanner <zacktanner@gmail.com>
parent 7a2db94d
......@@ -38,11 +38,7 @@ export function validateRevalidate(
return normalizedRevalidate
} catch (err: any) {
// handle client component error from attempting to check revalidate value
if (
err &&
typeof err === 'object' &&
err.message?.includes('Invalid revalidate')
) {
if (err instanceof Error && err.message.includes('Invalid revalidate')) {
throw err
}
return undefined
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment