Next.js Discord

Discord Forum

Valid value in getStaticProps becomes undefined on server

Unanswered
Pacific anchoveta posted this in #help-forum
Open in Discord
Pacific anchovetaOP
Hi,
Using the T3 stack (Nextjs pages router + TRPC + prisma), I am trying to perform certain actions on the server via getStaticProps.

I have two dynamic routes: /[householdId]/shopping-list/[id].tsx

In [id].tsx's getStaticProps I am accessing both dynamic values in order to prefetch data via TRPC.

However, householdId becomes undefined for some reason in the TRPC route, even though it has a value while still in getStaticProps. The id value works.

I've created a post on stackoverflow about this, since there is a text limit on discord.
I would really appreciate any help or direction!

https://stackoverflow.com/questions/77011560/valid-value-in-getstaticprops-becomes-undefined-on-server

1 Reply

Pacific anchovetaOP
Anyone, please? :lolsob: