0

So I did everything like this video https://www.youtube.com/watch?v=UHSipe7pSac but after that I got this error :

:( "ERROR in ./resources/js/app.js 4:0-28 Module not found: Error: Can't resolve './vue/app'

this is my /resources/js/app.js file

require('./bootstrap');

import Vue from 'vue';

import App from './vue/App';

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

and this is my webpack.mix.js file

mix.js('resources/js/app.js', 'public/js').vue()
    .postCss('resources/css/app.css', 'public/css', [
        //
    ]);
3
  • 1
    What is the path to your App.vue file? Commented Sep 8, 2021 at 11:12
  • What is here resources/js/vue/App.js? Commented Sep 8, 2021 at 11:35
  • Also you shouldn't mix using imports and requires Commented Sep 8, 2021 at 11:35

1 Answer 1

1

You're using the Vue const itself as a component. (Aside from the other correct comments on your question)

import App from './vue/App'; <----- Uppercase App

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

Try changing those up. But even better, improve your naming. Like Home.vue

Happy coding!

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.