Closed technophile-04 closed 3 months ago
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 next:build
script in package.json but don't have next:serve
. Probably it's worth to add it
Side quest : 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 ?
As I understand it's moved to ISR block
btw we have next:build script in package.json but don't have next:serve. Probably it's worth to add it
Yup, makes sense! updated it, Thanks Rinat !
Thanks @technophile-04 , gj! Yes, looking a bit hacky but a much better solution than https://github.com/scaffold-eth/scaffold-eth-2/pull/824
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: | Main | This Branch | | ----- | ------------ | | ![Screenshot 2024-04-23 at 11 59 53 PM](https://github.com/scaffold-eth/scaffold-eth-2/assets/80153681/a49d3c42-093e-4b37-9ec8-0c65dc4453ef) | ![Screenshot 2024-04-24 at 12 01 01 AM](https://github.com/scaffold-eth/scaffold-eth-2/assets/80153681/0dcd362e-6d3b-42e5-bce2-76b92347a5e8) | 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:
![Screenshot 2024-04-24 at 12 01 33 AM](https://github.com/scaffold-eth/scaffold-eth-2/assets/80153681/515341f8-3eba-425d-8978-d91f2d539f10)