8000 [Bug]: ISR not working as expected · Issue #1028 · opennextjs/opennextjs-netlify · GitHub
[go: up one dir, main page]

Skip to content
[Bug]: ISR not working as expected #1028
Closed
@caleblawrence

Description

@caleblawrence

Summary

I can't get ISR to work with Netlify even though it's working on Vercel and locally. Example page:

import React from "react";

const ISRTest = ({ time }) => {
 
  return (
      <div style={{margin: 50}}>
            <p style={{fontSize: 30}}>{time}</p>
      </div>
  );
};

export async function getStaticProps() {
  const currentTime = new Date()
  currentTime.toLocaleString('en-US', { timeZone: 'America/New_York' })

  console.log("currentTime", currentTime);
  return {
    props: {
      time: currentTime.toLocaleTimeString(),
    },
    revalidate: 60,
  };
}

export default ISRTest;

If I look at the function logs for Function ___netlify-odb-handler I see:

9:24:34 AM: 27fd4a59 INFO   currentTime 3:24:34 PM

And this log appears every 60 seconds when I refresh the page like I would expect however the page never changes from the time when it was deployed (cache is never refreshed?).

Steps to reproduce

See summary

A link to a reproduction repository

No response

Plugin version

4.1.0

More information about your build

  • I am building using the CLI
  • I am building using file-based configuration (netlify.toml)

What OS are you using?

Mac OS

Your netlify.toml file

[build]
publish = ".next"

[[plugins]]
package = "@netlify/plugin-nextjs"

Your public/_redirects file

`_redirects`
# Paste content of your `_redirects` file here

Your next.config.js file

module.exports = {
reactStrictMode: true,
images: {
domains: ["imgurl.com"],
},
};

Builds logs (or link to your logs)

Build logs
# Paste logs here

Function logs

Function logs
# Paste logs here

.next JSON files

generated .next JSON files
# Paste file contents here. Please check there isn't any private info in them
# You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugcode to address defects in shipped code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0