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
joulev
Weird… can you try a lower version?
Answer
joulev
Like 13.4.19
Then 13.4.18 and so on
A few hours ago a user also asked me this exact same issue
Southern African anchovyOP
it's
"next": "13.5.2",
Alfonsus Ardani
have you tried refreshing twice after the 10th second
Southern African anchovyOP
yes
Are you on windows
Southern African anchovyOP
yeah windows 11
joulev
Ok this smells like a windows-specific bug here cc @Florian
Try deploying on vercel (linux), does this bug occur?
Alfonsus Ardani
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 Ardanijoulev
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
Florian
That's weird
If you are on Chrome, can you try it on Firefox with the latest
next
version? that worked for me 😆Alfonsus Ardani
bonkers haha