Erro 404 quando atualizo a pagina no github.io #46362
Replies: 3 comments
-
E ai @cleitondcarmo Acho que o GitHub Pages está tendo problemas com as rotas, no seu arquivo import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import AboutView from '../views/AboutView.vue'
import ContactView from '../views/ContactView.vue'
import ProjectsView from '../views/ProjectsView.vue'
const router = createRouter({
base: `/${process.env.NODE_ENV === 'production' ? 'cleitondcarmo.github.io/' : ''}`,
mode: 'history',
history: createWebHistory(`/${process.env.NODE_ENV === 'production' ? 'cleitondcarmo.github.io/' : ''}`),
routes: [
{
path: '/',
name: 'home',
component: HomeView
},
{
path: '/about',
name: 'about',
component: AboutView
},
{
path: '/contacts',
name: 'contacts',
component: ContactView
},
{
path: '/projects',
name: 'projects',
component: ProjectsView
},
]
})
export default router Não sei ao certo se isso funcionaria porque utilizei Vue umas 2 vezes apenas, mas se você pesquisar por Tem alguns lugares que sugerem criar um arquivo https://stackoverflow.com/questions/50175802/deploy-vue-to-github-pages-error-with-vue-router |
Beta Was this translation helpful? Give feedback.
-
Consegui resolver trocando createWebHistory por createWebHashHistory( ) no router. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
Tenho esse site https://cleitondcarmo.github.io onde a pagina principal pode ser atualizada sem problemas, mas em outra pagina como por exemplo https://cleitondcarmo.github.io/contacts quando é atualizada da o erro 404 File not found. Alguém sabe o que pode ser?
Beta Was this translation helpful? Give feedback.
All reactions