Redirect browser path not changing when manually editing it #9686
Unanswered
haleksandre
asked this question in
Q&A
Replies: 1 comment
-
Upon further investigation, looks like the weird path issue isn't with SvelteKit but Vite PWA plugin which doesn't trigger server-side requests on manual URI requests so the server-side hook & load don't run when manually going back to a path that redirected you, in this case |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently encountering a weird issue.
On initial load/hard refresh, the app redirects the user from
/
to the sign-in page/signin
. So far so good, the hook runs, the server-side/client-side load runs & the browser indicates the correct path/signin
. If I try my sign in everything works as expected.the form correctly calls the action
signin
within the/signin/+page.server.ts
file.When manually changing the path from the address bar from
/signin
to/
. The redirect happens since I see the sign-in page but somehow for some reason the path in the browser address bar remains/
. Then when I try the above form I get a 405 error.405 POST method not allowed. No actions exist for this page
.I'm guessing since the browser URI is set to
/
& the action isaction="?/signin"
SvelteKit looks for the action within/+page.server.ts
file & not/signin/+page.server.ts
even though the page shown is within/signin
.I can, of course, work around that by changing the form's action to an absolute path like so
action="/signin?/signin"
but Im wondering why when I manually change the path in the browser's address bar SvelteKit load the right page but the path in the address bar doesn't change & then this problem, & potentially other, occurs?Beta Was this translation helpful? Give feedback.
All reactions