fix broken blockexplorer address page #699
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context :
This was introduced in #688 which we recently merged. We removed "use client" from components like
AddressInput
,EtherInput
etc in #688 because there was lint warning in them as mentioned in #686.Reason why #698 happened :
If you look at the error it occurred at
blockexplorer/address/[address]/page.tsx
and the cause of the error isAddressInput
, but we are not usingAddressInput
anywhere instead we are usingAddress
component which comes from~~/components/scaffold-eth/index.ts
barrel file and since this barrel file also exports inputs barrel we are indirectly importingAddressInput
in address page (although we are not using it).Solution :
I would suggest going through this comment discussion vercel/next.js#46795 (comment) once its really nice.
For now, I added a quick fix which is completely fine. An alternate solution is we can add "use client" to
~~/components/scaffold-eth/index.ts
since all the SE-2 components are reactive and expected to be used on the client.But yeah I think a future-proof solution might be removing barrel files at least from the components folder