Repository navigation
Prevent building the page in run time when fallback is set to true #12613
Unanswered
MohammadPCh
asked this question in
Help
Replies: 4 comments 7 replies
|
It will build a page, but the page logic itself can know whether data exists for |
6 replies
|
Any update? |
0 replies
|
Dear @brianlovin , |
1 reply
|
what about setting the preview mode to true for bad requests ? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
All reactions