S
SolidJS•2w ago
snorbi

Error during navigation

I have an error during navigation, possibly because of mishandling URL parameters by the router's useSearch() or useParams() (but this is only a guess). My problem is that the stack trace does not help at all, I attached a screenshot. Do you have any ideas how can I track the real location of the error? Thanks.
No description
4 Replies
snorbi
snorbiOP•2w ago
I just don't find any determinism in its behaviour 😦 Sometimes it works but most of the times it throws the above error. The pages are fairly complex, so I cannot extract a minimal reproducer easily 😦 It seems I found it by experimenting and commenting out navigation-related code fragments. It took a long time 😦 I had <Navigate> components inside the fallback parameter of Show components on the problematic pages. Removing the <Navigate> fallbacks solved the problem.
Madaxen86
Madaxen86•2w ago
If you checked a signal of createResource or createAsync in the Show component maybe it would have helped to add the deferStream:true to the primitive.
snorbi
snorbiOP•2w ago
The <Show> component uses a condition whether the page should be displayed at all (by validating parameters in the URL), or redirected to a fallback page using a <Navigate>. Maybe this is not the best solution for redirecting to another page based on a condition?
peerreynders
peerreynders•2w ago
I'd standardize on throwing redirects in critical querys instead of using useNavigate and Navigate. If you warm the query in the preload the redirect will happen as soon as the first createAsync tries to connect to it.

Did you find this page helpful?