TypeError: Cannot read properties of null (reading 'useContext')
Hey Guys,
I'm experiencing an issue with my builds as of today.
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
6 Replies
Ok so, It seems like it the issue is not the dynamic server usage but:
the issue is I don't have a 404 error file defined. I use the default built in one.
Have you ever solved this?
I've had this same problem for months and I'm reaching my limit lol
Same
Yo, little update here. I saw some people saying this error is related to some node modules using the wrong version of React.
POSSIBLE FIX: I've added this to my package.json and haven't had this error in a day, will update again in the future:
Update: this did not fix it lol
make sure it suits the react version of your project
My specific error was I manually synchronize my computer's time rather than automatically using Apple Servers, or location services. This cause the JWT authorization to "unsync" because of the time.
Once I turned on automatic time, it fixed the problem
Yeah, I'm pretty sure this has something to do with caching.
There's a very weird scenario that is pretty replicable: when you edit an endpoint and this error starts occurring, try ctrl-zing the change and the error will go away.
This makes me believe there's some kind of caching bug and this error is just completely wrong lol