router icon indicating copy to clipboard operation
router copied to clipboard

Context is undefined in __root__ match

Open maksymskuibida opened this issue 1 year ago • 3 comments

Describe the bug

Randomly context in __root__ is undefined. Devtools show that context is defined in layout route $lang matcg under __root__, but at the same time is undefined in __root__ match. I cannot even catch exact situation when it happens on my website. Sometimes I open website and it crashes with "cannot descructive property ... from undefined" error. I managed to replace in all my cases useRouteContext({from: "__root__"}) to useRouteContext({from: /$lang"}) and now it is not happen, but it is still an issue, I think

Your Example Website or App

Steps to Reproduce the Bug or Issue

I don't have exact steps to reproduce.

Expected behavior

I excpected if I set context in <RouterProvider> it will be available always

Screenshots or Videos

No response

Platform

  • Version 1.34.9 — 1.36.3 probably earlier that 1.34.9, I have updated from 1.33.4 to 1.34.9 and the issue was introduced and still persist

Additional context

No response

maksymskuibida avatar Jun 13 '24 09:06 maksymskuibida

I'm also still experiencing issues with undefined context in the latest release and since the last several versions. The latest PR addressing the issue did nothing for me. Can also confirm that downgrading to 1.33.4 fixes all the undefined context issues. Seems it was introduced in 1.33.6.

aleluman avatar Jun 13 '24 13:06 aleluman

I did some more testing and not all issues with context are fixed in 1.33.4, context is always available, but some variables inside context are undefined. I had to revert all the way back to 1.31.0 to fix these issues, seems like everything started to break in 1.31.1.

aleluman avatar Jun 13 '24 14:06 aleluman

can you please provide a minimal complete example by forking one of the existing examples on stackblitz?

schiller-manuel avatar Jun 13 '24 16:06 schiller-manuel

Closing this, since there's no reproduction. Plus, #1892 seems to be a similar issue with a reproduction available.

SeanCassiere avatar Jul 04 '24 20:07 SeanCassiere