Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getStaticProps is not called #76

Closed
MLerasle opened this issue Mar 12, 2020 · 2 comments
Closed

getStaticProps is not called #76

MLerasle opened this issue Mar 12, 2020 · 2 comments

Comments

@MLerasle
Copy link

I just tried to migrate from getInitialProps to getStaticProps but the new method is never called.

Just try with the documentation example to reproduce:

import fetch from 'node-fetch'

function Blog({ posts }) {
  return (
    <ul>
      {posts.map(post => (
        <li>{post.title}</li>
      ))}
    </ul>
  )
}

export async function getStaticProps() {
  console.log('Call getStaticProps')
  const res = await fetch('https://.../posts')
  const posts = await res.json()

  return {
    props: {
      posts
    }
  }
}

export default Blog
@BjoernRave
Copy link
Contributor

@MLerasle should be fixed with: #75 . Just update to 0.10.6 and it should work :)

@MLerasle
Copy link
Author

@BjoernRave wow 7 minutes to solve the issue and reply, thank you very much :)
This is working like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants