Error: No route matches URL - when using redirectBack #151
Unanswered
piotrkulpinski
asked this question in
Q&A
Replies: 2 comments
-
Here's full error response:
The route is valid, the problem is that it's an absolute url rather than relative one. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Currently, I'm using this as a workaround, but if someone else is having the same issue, maybe it's a good idea to add it to the core: function redirectBack(
request: Request,
{ fallback, ...init }: ResponseInit & { fallback: string }
): Response {
const referer = request.headers.get('Referer')
const origin = request.headers.get('Origin')
return redirect(referer?.replace(origin, '') ?? fallback, init)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Recently I started to have some weird issues with
redirectBack
helper.Not sure if something changed in this library on in Remix itself, but if I use the helper, I get
Error: no route matches URL
every time. The route is valid, but the Referer returns the full url with origin so maybe that's the reason.Has anyone have a similar issues?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions