Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

OrchidDev's avatar

Module not found: Error: Can't resolve ' Vuejs

Hi... In the router section, we want to route the pages through Nested Routes, but there is a problem, it does not recognize the pages ...

Codes:

{
            path: '/',
            component: require('../view/layout/Layout').default,
            children: [
                {
                    path: '',
                    component: require('../view/Home').default,
                    name: 'home'
                },
                {
                    path: 'post/:slug',
                    component: require('../view/Post/PostShow').default,
                    name: 'post-show'
                },
            ]
},
        
   

Errors:

ERROR in ./resources/js/view/layout/Layout.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/view/layout/Layout.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '../components/Navigationdrawer' in '/home/../Desktop/../resources/js/view/layout'
 @ ./resources/js/view/layout/Layout.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/view/layout/Layout.vue?vue&type=script&lang=js&) 11:0-62 16:22-38
 @ ./resources/js/view/layout/Layout.vue?vue&type=script&lang=js&
 @ ./resources/js/view/layout/Layout.vue
 @ ./resources/js/router/router.js
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js ./resources/sass/app.scs
0 likes
3 replies
piljac1's avatar

The code you posted doesn't seem to be the culprit. Where are you importing/requiring you navigation drawer ? If you're on Mac/Linux, you're probably encountering a case issue (you're importing Navigationdrawer and not NavigationDrawer). That's my guess.

2 likes
OrchidDev's avatar
OrchidDev
OP
Best Answer
Level 1

@piljac1 Hello... Thanks for the answer ... I solved the problem of wanting to call the file to other pages. We should call like this:

import Navigationdrawer from "../../components/Navigationdrawer";
krishna8723's avatar

Make sure to add .vue() on webpack.mix.js

mix.js('resources/js/app.js', 'public/js')
   .vue()
2 likes

Please or to participate in this conversation.