2

So I have finally deployed my full stack Java Spring Boot app (my backend server) and frontend on Render, with database runing on Railway.

Here is the link: https://shoppinglistapp-k7td.onrender.com/

My problem is the app runs fine on my local machine but after delpoyed, almost all the buttons that I clinck lead to a "Not Found" page. I have to go back, refresh, click the button again to see the content.

For example, after logging in, if you click logout, it should take you back to the login page but instead, it takes you to a "Not Found" page. You have to go back and refresh, otherwise the login page wont load.

I am only a recent graduate and I would love to get some help.

I have tried upgrading my free Render webservice to a paid plan as I thought it was because the server was responding too slow, but the problem remains.

const router = new Router({ mode: 'history', base: process.env.BASE_URL, routes: [ { path: '/', name: 'home', component: Home, meta: { requiresAuth: true } }, { path: "/login", name: "login", component: Login, meta: { requiresAuth: false } }, { path: "/logout", name: "logout", component: Logout, meta: { requiresAuth: false } } ] })

2
  • I tried your web app. Something looks buggy in the way you have routed your login page. I believe the issue is present in the login page only. Can you please post the code snippet of how you are routing to the pages? Commented Feb 9, 2023 at 3:04
  • @SaarthakGupta this happens to all the actions that I do in my App actually. I just added the routing codes Commented Feb 9, 2023 at 3:18

1 Answer 1

1

I believe this is due to the configuration of the front-end server (nginx or Apache etc...) on which you have deployed your Vue app. That's the reason, it is working on your local & not working when you deploy it. You might need to configure your frontend deployed server configuration.

Please check this link out: Vue Router return 404 when revisit to the url

I can help you out more if you provide me with your deployed frontend server details.

Sign up to request clarification or add additional context in comments.

2 Comments

I just checked the hosting service you are using i.e. render. Did you try this out? render.com/docs/deploy-vue-js#using-client-side-routing
No, but I just tried it and the site is working perfectly now!! thank you so much!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.