justboil / admin-one-vue-tailwind

Free Vue.js 3.x Tailwind 3.x admin dashboard template with dark mode. Vite builds. Pinia state. Laravel integration available
https://justboil.github.io/admin-one-vue-tailwind/
MIT License
2.14k stars 402 forks source link

ReferenceError: RouterLink is not defined in NavBarItem.vue in Laravel integration #14

Closed tfrazzet closed 2 years ago

tfrazzet commented 2 years ago

When following the Laravel 9 integration guide, you get this error:

Uncaught (in promise) ReferenceError: RouterLink is not defined at ReactiveEffect.fn (NavBarItem.vue:26:5) at ReactiveEffect.run (reactivity.esm-bundler.js:185:25) at get value [as value] (reactivity.esm-bundler.js:1147:39) at unref (reactivity.esm-bundler.js:1053:29) at Object.get (reactivity.esm-bundler.js:1056:37) at Proxy._sfc_render (NavBarItem.vue:97:10) at renderComponentRoot (runtime-core.esm-bundler.js:888:44) at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5600:57) at ReactiveEffect.run (reactivity.esm-bundler.js:185:25) at instance.update (runtime-core.esm-bundler.js:5714:56)

The solution is change line 26 of "resources/js/Components/NavBarItem.vue" replacing "RouterLink" component from vue-router module with "Link" component form inertia-vue3 module.

resources/js/Components/NavBarItem.vue 26 - return RouterLink; 26 + return Link;

vikdiesel commented 2 years ago

Now fixed. Thanks for contribution)