#Error when setting context
19 messages · Page 1 of 1 (latest)
I ran into this a few times, but I couldn't make a minimal reproduction. Can you try reproducing this somewhere? Either in the playground or a stackblitz or a simple repo?
I get this error in dynamic route
Yes I think that's where it is most likely to happen but maybe also in other cases where rendering is dynamic like using Resource.
yeah, I am doing a fetch in useClientEffect$
Interesting, I wonder if this is an issue with the element where the effect is run going away then? You could try adding a cleanup function to the effect which only console log and see if the error pops up after the console output.
I just had to us the <a> instead of Link, tho causes the page to reload
Sure that would work, but not really pinpointing the issue 😅
Sadly
Hi, bit of an update, I don't have a reproduction but the issue for me was happening when the context was created in root.tsx and the update to the state was happening in a nested layout.
The behaviour was super inconsistent too, with it working for signals but not stores sometimes but the other way around worked other times.
I was not using a dynamic route.
The update was created during a client effect I believe.
Hi guys... using <a> in production, makes all pages stuck at the index page. those with <Link> work ok, just that when navigating to some pages with context I get this error "element must be connected to the dom"
That's just weird. How would a normal A link be stuck?
Update, in dev mode, I get the error. In preview and build mode the issues don't come up, and I navigate ok.
But this is bad to say the least and it is had to debug or reproduce
This matches my experiences.
Do you or @gritty kestrel have a reproduction, I can try get around to making one when I'm back in the office next week but it seems quite difficult to do.