Skip to content

Disable build-time fetching in CI environment? #24554

Answered by bobarros
kevineinarsson asked this question in Help
Discussion options

You must be logged in to vote

Why you can't do this inside getStaticProps? Maybe also some error control when you're using other code to catch/login data, so your build will not crash.

export const getStaticProps: GetStaticProps = async () => {

const data = await getData;

if(data)
  return {
    propsData
  };
} else {
  return {
    propsWithoutData
  };
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kevineinarsson
Comment options

Answer selected by kevineinarsson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants