gcunha's avatar

Laravel Mix error on VueJS compiling

Hello, I cannot make VueJS to work in my Laravel 8 application.

These are the commands I ran, according to the documentation:

composer require laravel/ui

php artisan ui vue

npm install

npm run dev

This is the output I get. Any thoughts? Could not find anything relevant on my searches.

> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js

/var/www/pmdb/node_modules/webpack-cli/bin/cli.js:93
				throw err;
				^

AssertionError [ERR_ASSERTION]: mix.js() is missing required parameter 1: entry
    at Function.js (/var/www/pmdb/node_modules/laravel-mix/src/Assert.js:13:9)
    at JavaScript.register (/var/www/pmdb/node_modules/laravel-mix/src/components/JavaScript.js:40:16)
    at Api.mix.<computed> [as vue] (/var/www/pmdb/node_modules/laravel-mix/src/components/ComponentFactory.js:98:53)
    at Object.<anonymous> (/var/www/pmdb/webpack.mix.js:15:6)
    at Module._compile (/var/www/pmdb/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (/var/www/pmdb/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/var/www/pmdb/node_modules/laravel-mix/setup/webpack.config.js:12:1)
    at Module._compile (/var/www/pmdb/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (/var/www/pmdb/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at WEBPACK_OPTIONS (/var/www/pmdb/node_modules/webpack-cli/bin/utils/convert-argv.js:114:13)
    at requireConfig (/var/www/pmdb/node_modules/webpack-cli/bin/utils/convert-argv.js:116:6)
    at /var/www/pmdb/node_modules/webpack-cli/bin/utils/convert-argv.js:123:17
    at Array.forEach (<anonymous>)
    at module.exports (/var/www/pmdb/node_modules/webpack-cli/bin/utils/convert-argv.js:121:15)
    at /var/www/pmdb/node_modules/webpack-cli/bin/cli.js:71:45
    at Object.parse (/var/www/pmdb/node_modules/webpack-cli/node_modules/yargs/yargs.js:576:18)
    at /var/www/pmdb/node_modules/webpack-cli/bin/cli.js:49:8
    at Object.<anonymous> (/var/www/pmdb/node_modules/webpack-cli/bin/cli.js:366:3)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/var/www/pmdb/node_modules/webpack/bin/webpack.js:156:2)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}
0 likes
5 replies
tykus's avatar

What is your Laravel Mix version?

chaudigv's avatar

Please share your webpack config as well.

gcunha's avatar

Here's my webpack.mix.js file. This was created automatically when I installed the vue scaffolding through Laravel UI. I did not modify anything at all.

const mix = require('laravel-mix');

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

Laravel framework version: v8.16.1

Laravel UI version: v3.2.0

sr57's avatar

Other solution install Vue via breeze or jetstream with inertia

or without starter kit :

npm i -D laravel-mix@next vue@next @vue/compiler-sfc vue-loader@next

Please or to participate in this conversation.