[Vue] Error: Invalid route component at extractComponentsGuards 오류 해결

어느 개발자·2022년 4월 18일
0

vue-router 설정 시 다음과 같은 에러가 발생한다면

vue-router.esm-bundler.js?6c02:3302 Error: Invalid route component
    at extractComponentsGuards (vue-router.esm-bundler.js?6c02:1987:1)
    at eval (vue-router.esm-bundler.js?6c02:3143:1)

Named Views 를 사용하는 것이 아니라면 componentscomponent 로 변경한다.

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'Home',
      components: Home, // FIXME (component로 변경)
    },
  ],
});

0개의 댓글