Rank 1: Thread
So I'm using vite/react, which is spa, and it used to work before, but now whenever I go to any route except the root it shows appwrites 404 page, instead of using my routing, why is this?
Votes
0
Replies
24
Participants
2
Messages
25
Rank 1: Thread
So I'm using vite/react, which is spa, and it used to work before, but now whenever I go to any route except the root it shows appwrites 404 page, instead of using my routing, why is this?
Do you get any errors while deploying the site? Also, which region you're using?
Rank 1: Thread
NY, and I don't think so, let me check
Rank 1: Thread
other than from postcss, no
You said it used to work before and it's a SPA, then what do you mean by routing? Have you added more routes/pages recently?
Rank 1: Thread
Everything should route to index.html, and the code inside my project is what should do the routing, using react-router. I belive their are new routes, I don't think that could be a cause
Rank 1: Thread
And it used to work.
Can you share with me the deployed link?
Rank 1: Thread
As I can see, you're directly using /account route here upon clicking the login/signup button instead of a /login or /signup route which means the user is getting redirected directly to the /account route even before he/she could login or signup. Don't you have any /login or /signup route?
Rank 1: Thread
/account redirects to the login page if no account is signed in, but that route doesnt work either, which would be /auth/login
Rank 1: Thread
it could be the lazy loading, but it's work in the past with it so
Rank 1: Thread
my other vite project still works fine, which is werid because its basically the same setup
Rank 1: Thread
idk if I fucked something up or not, but it's still weird
If you don't mind and if you're comfortable, can you share the code for this? Then only I'll be able to tell if it's a mistake from your side or anything else
Rank 2: Process
Rank 2: Process
I just set it to a public repo for a sec
In this part of your AccountCard.jsx :
<a href="/account">
<GlintButton>Manage Account</GlintButton>
</a>
.
.
<a href="/account">
<GlintButton>Log In or Sign Up</GlintButton>
</a>
Can you try replacing it with Link component from react-router-dom? Like this:
<Link to="/account">
<GlintButton>Manage Account</GlintButton>
</Link>
.
.
<Link to="/account">
<GlintButton>Log In or Sign Up</GlintButton>
</Link>
If it's really a routing issue, then this will solve it. And if it's something else, it won't. Try this and let me know the results.
Rank 2: Process
ok so going back to old builds on appwrite, i discovered this is the commit that broke it
https://github.com/Flamality/index/commits/b2ed49e90ae21684f6af5331e8d6f8b54e5075de
Rank 2: Process
so anything after alpha 10 doesnt work
Rank 2: Process
ima fuck with some things and see if anything does anything
Rank 2: Process
the output files are basically identical apart from the assets folder which contains the javascript, so I'm pretty sure its an appwrite issue. Im not sure why it isn't putting all routes to index.html
Rank 2: Process
I FIXED IT
Rank 2: Process
inside build settings I didn't have a Fallback file set, changing it to index.html fixed it!!!