-
I could imagine being able to remove paths based on preview mode would be useful for build-time optimization. Eg. working on notion-blog ijjk/notion-blog#22 it became clear that you would want to fallback in the case of an unpublished post so that time was not wasted on the production build generating pages for unpublished posts. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
tl;dr By design, As there's no fallback behavior in preview mode, running |
Beta Was this translation helpful? Give feedback.
tl;dr
getStaticPaths
is never re-ran at runtime, including while in preview mode (so it cannot be aware).By design,
getStaticProps
is meant to handle inputs not returned bygetStaticPaths
(this is one of the reasonsgetStaticPaths
cannot pass data togetStaticProps
).As there's no fallback behavior in preview mode, running
getStaticPaths
is unnecessary (preview mode treats every path req as-if it were returned fromgetStaticPaths
).