[Vuejs]-[Vue warn]: invalid template option:

0👍

For the correct usage of my particular versions of vue & vue-router

resources/js/app.js


import LoginComponent from "./components/LoginComponent.vue";

import './bootstrap';
const Home = { template: '<div>Home</div>' }

const routes = [
    { path: '/', component: Home },
    { path: '/login', name: "Login", component: LoginComponent },
]

resources/views/layouts/app.blade.php

<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>{{ config('app.name', 'Laravel') }}</title>

    <!-- Scripts -->
    @vite(['resources/sass/app.scss', 'resources/js/app.js'])
</head>
<body>
    <div id="app">
            <p>
                <router-link to="/">Go to Home</router-link>
                <router-link to="/login">Login</router-link>
            </p>

            <router-view></router-view>
    </div>
    <script src="https://unpkg.com/vue@3"></script>
    <script src="https://unpkg.com/vue-router@4"></script>
</body>
</html>

Leave a comment