[Vue warn]: Unknown custom element: – When running jest unit tests

This is how I was able to get rid of the annoying warning: Include RouterLinkStub, eg.: import { shallowMount, createLocalVue, RouterLinkStub } from ‘@vue/test-utils’; Map NuxtLink stub to RouterLinkStub const wrapper = shallowMount(TestItem, { … stubs: { NuxtLink: RouterLinkStub } }) And in case you were checking nuxt-link text or something, change: const link = … Read more

vuejs – Redirect from login/register to home if already loggedin, Redirect from other pages to login if not loggedin in vue-router

Here’s what I’m doing. First I’m using a meta data for the routes, so I don’t need to manually put all routes that are not requiring login: routes: [ { name: ‘About’ // + path, component, etc }, { name: ‘Dashboard’, // + path, component, etc meta: { requiresAuth: true } } ] Then, I … Read more

Vue.js – Component is missing template or render function

FOR vue-cli vue 3 render function missed in createApp. When setting your app by using createApp function you have to include the render function that include App. in main.js update to : FIRST change the second line in javascript from:- const { createApp } = Vue to the following lines: import { createApp,h } from … Read more

tech