Laravel Mix Vue Page showing Blank

39 Views Asked by At

When I am running npm run dev or npm run production, I am getting an error that the Vue file does not have loaders defined.

I resolved this by using this resouce:
Compillation problem of extensions in vuejs

I used .vue in my webpack.mix.js.

Here is the example:

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

This enabled npm run dev to compile, but after compilation my Vue page got blank and this error is showing in console:

Console error message

Laravel Version is 10
Node Version is 16
Laravel-mix version is 6.0.49

1

There are 1 best solutions below

1
Ishant Kumar On

This issue has been resolved now we have to change vue import in app.js file From window.Vue = require("vue"); TO window.Vue = require("vue").default;