#Reload Loader requests fail after action
1 messages · Page 1 of 1 (latest)
Happening to me too - did you figure out a cause?
without any example code it's kind of hard to diagnose any problem there. It can be any number of things
i understand that. but there's no difference between the two actions
one action causes reload
other does not
same output, same everything
A test repo or something to toy around with is somewhat necessary to be able to see the issue in action and understand the exact behavior you're looking for. I get that there's different results you're seeing but with no code to look at and troubleshoot there's not an exact answer. It's a problem that could have many reasons behind given the information "i make a post on an action then my loader runs again and its fine, I make a post on another action that updates the entry and my loader fails"
So, I don't think I have the same problem as the above. In my case, I'm making a fetcher.load call to a resource route to validate some coupons. If that coupon is invalid (I save the response in component state), when I submit the main form on my current route, I delete the coupon from the formData entries prior to submitting (via an onSubmit handler).
In my case, if I validate a coupon at all (that is, hit my resource route) and submit the main form on my page:
- my coupon gets validated and I get some response from the resource route
- my current route's action function runs perfectly and returns a response, but after that...
- all the requests remix triggers for loader revalidation get cancelled, which looks like the screenshot in this question
For reference, I was trying @undone halo's approach to creating a "full-stack" combobox, but something seems to be breaking in my adaptation!
Edit to add: Sharing here in case anyone else faces this in future! I'll try and add examples of this + update with a solution if I find one.
I'd be really interested to see a minimal reproduction of the issue, let me know if you can get one
you dont think its a good idea to suggest what could be the potential issues?
the thing is, there are many potential issues, I don't know of any issues with the framework itself that would cause such behavior so I can't suggest anything in that area. Maybe someone in the team might know of this behavior, or maybe it's not a framework issue.
With some example code it can provide context that'll help rule out "easy" issues and better direct advice. But outside of that there isn't really much to suggest other than saying typical behavior of different posting methods. Like if you use a fetcher you should expect to not navigate to a new page, if you use a Form you should expect to always redirect somewhere
not sure if its just cause when fetcher sends req to /products/$productId/someroute then it reloads, but i do anything else like maybe /coupons/apiroute it doesnt.
not sure why would that matter much anyways, as the api route starting with products just returns json and then it reloads the /products/$productId page where its on
so to clarify, you have a fetcher that submits a POST request, then you reload the page when it's done and it errors?