You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #4046, we override the URL parameters for a GET request. Since Fetcher uses this under the hood, the ?index search string gets wiped from the URL. Then when calling getFetcherRequestMatch, match.route.index is no longer true, so it can’t find the index route anymore, so it calls the default fetcher, which silently returns undefined.
(I also happened to be relying on the old behaviour by submitting action: “?index¶meter=true” which broke in the new version, but I didn’t realise you could use the first parameter. Only mentioning in case someone else has the same problem.)
This was a regression on our part - normal form GET submissions run all loaders and thus don't need the ?index param, but this fetcher.submit({}, { method: 'get' }) case was overlooked. Sorry about that! Fixed in #4238 and should be released soon 👍
What version of Remix are you using?
1.7.1
Steps to Reproduce
Create a manual
Fetcher
, perhaps usinguseFetcher
. Then submit it against the index route using a GET request.(I’m calling this from the index route, so I think you can omit all of these options. But worth being verbose to explain the error.)
Expected Behavior
This code should call the index loader & return its data in
fetcher.data
Actual Behavior
fetcher.data
is undefined(this example in the docs is now broken, BTW)
Reason
In #4046, we override the URL parameters for a GET request. Since
Fetcher
uses this under the hood, the?index
search string gets wiped from the URL. Then when callinggetFetcherRequestMatch
,match.route.index
is no longer true, so it can’t find the index route anymore, so it calls the default fetcher, which silently returnsundefined
.(I also happened to be relying on the old behaviour by submitting
action: “?index¶meter=true”
which broke in the new version, but I didn’t realise you could use the first parameter. Only mentioning in case someone else has the same problem.)Workaround
You have to downgrade to 1.7.0. I tried:
But this doesn’t work because it only matches against a bare
index
parameter, which I can’t pass using this object.The text was updated successfully, but these errors were encountered: