TypeError: Cannot read properties of null (reading 'useContext')

Hey Guys,

I'm experiencing an issue with my builds as of today.

TRPCClientError: Dynamic server usage: Route /dashboard/home couldn't be rendered statically because it used cookies. See more info here: https://nextjs.org/docs/messages/dynamic-server-error


I went through the issues on GH and even implemented the changes merged in[https://github.com/t3-oss/create-t3-app/pull/1741] but i still could not get the issue to go away.

Some context:
  • The project is a Monorepo (T3-Turbo)
  • Almost all my TRPC routes use cookies
  • I have 2 TRPC providers per app (1 app specific, 1 shared)
    • The app is deployed on Azure App Service, not Vercel
What i've tried:
  • Adding 'export foce-dynamic' --did not help
    • in RSC components adding 'unstable_noStore' -- did not help
    • applied changes from PR #1741 - did not help
ANY help would be appreciated



all the pages according to the build log that have dynamic usage
> Export encountered errors on following paths:
        /(dashboard)/dashboard/(admin)/companies/page: /dashboard/companies
        /(dashboard)/dashboard/(admin)/users/page: /dashboard/users
        /(dashboard)/dashboard/(agent)/cargo-arrival/page: /dashboard/cargo-arrival
        /(dashboard)/dashboard/(agent)/cargo-release/page: /dashboard/cargo-release
        /(dashboard)/dashboard/(user)/documents/page: /dashboard/documents
        /(dashboard)/dashboard/(user)/expected-arrivals/page: /dashboard/expected-arrivals
        /(dashboard)/dashboard/(user)/shipment/page: /dashboard/shipment
        /(dashboard)/dashboard/(user)/shipped-items/page: /dashboard/shipped-items
        /(dashboard)/dashboard/(user)/tracking/page: /dashboard/tracking
        /(dashboard)/dashboard/(user)/wr-overview/page: /dashboard/wr-overview
        /(dashboard)/dashboard/home/page: /dashboard/home
        /(dashboard)/dashboard/profile/page: /dashboard/profile
        /_error: /404
        /_error: /500
Was this page helpful?