#Revalidate not working on build, but works on dev. Next 13.5.6

2 messages · Page 1 of 1 (latest)

vast gyro
#

Hi, I am aware that this issue happen to all of you before. But I didn't find any comment with solution.

This is the code I'm using for a job assessment that is needed to be done in NextJS 13.

export const metadata = {
title: "Privacy Policy",
};

const PrivacyPolicy = async () => {

const res = await fetch(
https://loripsum.net/generate.php?p=5&l=medium&d=1&a=1,
{
headers: {
"Content-Type": "text/html",
},
next: { revalidate: 10 },
}
);

const result = await res.text();

return (
<>
<h2 className="text-xl font-bold mb-3">Privacy Policy</h2>
<div dangerouslySetInnerHTML={{ __html: result }} />
</>
);
};
export default PrivacyPolicy;

From this I am expecting that every 10 seconds after second refresh of the page I get updated content from the loripsum.net. But content does not change. It works like it should on dev (npm run dev). But when I build it (npm run build and npm start) it shows the same content all the time.

edgy pewterBOT
#

🔎 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)