Search code examples
laravelvue.jsroutesvue-routervite

Laravel - 9 Vite with vue cli 3 - vue-router error


I can't fixed it please help. what is the issues. I need help. can't find out it.

Error Image Link: enter image description here enter image description here


Solution

  • Run: npm run watch
    Then move your files from /resources/js to /resources/js/src.
    Then, I suggest you make your file named route as a router.

    The name "components" or "views" does not matter, but I would prefer to create a folder named "views" and create "components" in it.

    Then you can try to import like these according to the path you will create:

    import Home from '../views/index.vue';
    

    or

    import Home from '../views/components/home/index.vue';
    

    Finally, don't forget to run: php artisan optimize:clear