Prevent building the page in run time when fallback is set to true #12613
Replies: 4 comments 7 replies
-
It will build a page, but the page logic itself can know whether data exists for |
Beta Was this translation helpful? Give feedback.
-
Any update? |
Beta Was this translation helpful? Give feedback.
-
Dear @brianlovin , |
Beta Was this translation helpful? Give feedback.
-
what about setting the preview mode to true for bad requests ? |
Beta Was this translation helpful? Give feedback.
-
Think About situation you set fallback true in getStaticPaths, for exmaple in this route:
https://example.com/movie/[id]/[name]
the correct URL is: https://example.com/movie/1/god-father
but user enters wrong URL, for example: https://example.com/movie/1/god
So What should we do?
By default, nextJS will build this page. but we don't want to build it, because of wrong name! we want to redirect it to correct URL.
There should be a solution for this, because for each wrong URL NextJS will build a useless file in disk.
Thank for your time.
Beta Was this translation helpful? Give feedback.
All reactions