0

I am following a YouTube tutorial, Todo List App with Laravel and Vue.js and 27 minutes I come across the following problem when running in the terminal 'npm run hot':

webpack compiled with 1 error ERROR in ./resources/js/app.js 4:0-28 Module not found: Error: Can't resolve './vue/app' in 'C:\xampp\htdocs\todolist2\resources\js'

The problem occurs on file app/resources/js/app.js

require('./bootstrap');
import Vue from 'vue'

import App from './vue/app'

const app = new Vue ({
    el: '#app',
    components: {App}
});

File structure is

js ---vue/app.vue app.js

I have run npm install beforehand and Vue is in the app/node_modules folder

Any ideas on how I can fix? Thank you!

2
  • I didn't understand about app/node_modules path. Do you mean your node_modules folder is inside the app folder, not in the root path? Commented Jan 19, 2021 at 2:46
  • Apologies, Emtiaz! The node_modules is in the root path. Commented Jan 19, 2021 at 3:17

1 Answer 1

0

In your webpack.mix.js add .vue() in the end like this

mix.js('resources/js/app.js', 'public/js')
    .postCss('resources/css/app.css', 'public/css', [
        //
    ]).vue();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.