-
Notifications
You must be signed in to change notification settings - Fork 913
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
add generateStaticParams to blockexplorer address and txHash #825
Conversation
Just asking for a review to know what you guys think 🙌, also we can completely close this if it feels too hacky ! Need to update component name, and maybe having other default txHash instead of using address as txHash? Will update it later |
btw we have |
As I understand it's moved to ISR block |
Yup, makes sense! updated it, Thanks Rinat ! |
Thanks @technophile-04 , gj! Yes, looking a bit hacky but a much better solution than #824 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach too. Yes, a bit hacky, but the hacky code is on the blockexplorer, a component that people are not usually going to modify.
Merging this! Thanks all for reviews and suggestion ! |
Description
An alternate solution to #824 (which doesn't require manual work)
As the error mentioned in #785 :
Therefore used
generateStaticParams
from NextJs.having the above code in blockexplorers
/[address]
&/[txHash]
, when NextJs build the prod version it will generate 2 static dummy pages and won't fail.Does having
generateStaticParams
break the blockexplorer when tinkering around on localnetwork ?No, since
dynamicPramas
are enabled by default it should generate that page on demand.So TLDR; nothing breaks (at least In my testing) there is no side effect to current version of SE-2 and also having
output:export
in next.config.ts works out of the box.The downside of the above thing, lol we have to add very hacky code in our codebase.
Side quest :
Also an difference which I noticed on vercel deployment:
Notice how on
main
branch is explicitly mentioned it spun up serverless functions for handling/blockexplorer
page but didn't mention about it on this branch deployment.Since
dynamicParams
are enabled are by default it ideally should have shown right ?If I go to logs of request I made, it shows their that its using serverless functions :
Demo image: