#Issue with ISR using App Router

24 messages · Page 1 of 1 (latest)

lilac scaffold
#

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>
  )
}
jovial lilyBOT
#

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

radiant harbor
#

Like 13.4.19

#

Then 13.4.18 and so on

#

A few hours ago a user also asked me this exact same issue

lilac scaffold
#

it's "next": "13.5.2",

ivory nimbus
radiant harbor
#

#discussions message

#

Are you on windows

lilac scaffold
#

yeah windows 11

radiant harbor
#

Ok this smells like a windows-specific bug here cc @supple sundial

#

Try deploying on vercel (linux), does this bug occur?

ivory nimbus
#

This wont help but It should work on 13.4.19 as ive been playing with revalidate a lot in windows

lilac scaffold
#

thought i'd try wsl quickly, same issue. let me grab my macbook ...

#

same issue on the mac

#

@radiant harbor works on "next": "13.4.19", I can see it updating now every 10 seconds. Thanks @ivory nimbus

radiant harbor
lilac scaffold
supple sundial
#

That's weird

#

If you are on Chrome, can you try it on Firefox with the latest next version? that worked for me 😆

ivory nimbus
#

bonkers haha