Working on my Laravel project, I encountered an issue while trying to implement a video chat feature using https://github.com/PHPJunior/laravel-video-chat?ref=madewithlaravel.com with laravel-echo-server. Despite trying various solutions, none seemed to work. The error message that appeared when running the command npm run dev was:
> @ development c:\xampp\htdocs\lsapp
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress
--hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
c:\xampp\htdocs\lsapp\node_modules\webpack-cli\bin\cli.js:231
throw err;
^
TypeError: Cannot read property 'js' of undefined
at Object.<anonymous> (c:\xampp\htdocs\lsapp\webpack.mix.js:14:5)
...
...
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Dimitrije\AppData\Roaming\npm-cache\_logs\2019-02-20T10_31
_27_681Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
...
In addition, here is my package.json file:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
...
},
"devDependencies": {
"axios": "^0.18",
"bootstrap": "^4.0.0",
...
},
"dependencies": {
"webpack": "^4.29.5"
}
}
Composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
...
}
After making a change in webpack.mix.js from const { mix } = require('laravel-mix'); to const mix = require('laravel-mix');, I encountered the following error:
...
To resolve this issue, additional dependencies must be installed. This requires running: npm install vue-template-compiler --save-dev --production=false
...
However, another error occurred:
...