Issue with ISR using App Router
Answered
Southern African anchovy posted this in #help-forum
Southern African anchovyOP
Hi all, i'm having a play with the new app router atm. I've used NextJS on a previous project using the page router. I'm having some issues with ISR on the new app router. Building the app locally for production and running I can see the time here never updates. I'm probably misunderstanding something, how do we invalidate a server component here?
import Link from 'next/link'
interface User {
id: number
name: string
}
export const revalidate = 10
export default async function UsersPage() {
const response = await fetch('https://jsonplaceholder.typicode.com/users', {
//cache: 'no-store',
next: {
revalidate: 10,
},
})
const users: User[] = await response.json()
return (
<main>
<h1 className={'text-xl'}>Users</h1>
<p>{new Date().toLocaleTimeString()}</p>
<ul>
{users.map((user) => (
<li key={user.id}>{user.name}</li>
))}
</ul>
<br />
<Link className={'text-xl'} href={'/'}>
Home
</Link>
</main>
)
}
22 Replies
Southern African anchovyOP
it's
"next": "13.5.2",
@Alfonsus Ardani have you tried refreshing twice after the 10th second
Southern African anchovyOP
yes
Southern African anchovyOP
yeah windows 11
Ok this smells like a windows-specific bug here cc @Florian
Try deploying on vercel (linux), does this bug occur?
This wont help but It should work on 13.4.19 as ive been playing with revalidate a lot in windows
Southern African anchovyOP
thought i'd try wsl quickly, same issue. let me grab my macbook ...
Southern African anchovyOP
same issue on the mac
@joulev works on
"next": "13.4.19",
I can see it updating now every 10 seconds. Thanks @Alfonsus Ardani@joulev You should open a bug report
Southern African anchovyOP
Thanks, yeah I was just looking on there to see if it's already been raised
That's weird
If you are on Chrome, can you try it on Firefox with the latest
next
version? that worked for me 😆bonkers haha