I had some weird issues with Vue still being called when using React as well. Have you tried deleting your node_modules folder and the package.lock.json file and doing a fresh npm install?
Exception when running "npm run watch-poll" after upgrading to 5.7
Hi,
I've just upgraded from Laravel 5.6 to 5.7: followed the upgrade docs and implemented all changes using the GitHub comparison tool.
I'm not using Vue but rather ReactJS and my webpack.mix.js calls "mix.react" accordingly.
After upgrading, I can no longer run "npm run watch-poll" - the following exception is thrown:
[path-removed]/laravel/node_modules/webpack-cli/bin/cli.js:235
throw err;
^
TypeError: Cannot read property 'find' of undefined
at updateCssLoader.rule ([path-removed]/laravel/node_modules/laravel-mix/src/components/Vue.js:43:26)
at Vue.updateCssLoader ([path-removed]/laravel/node_modules/laravel-mix/src/components/Vue.js:91:21)
at Vue.updateCssLoaders ([path-removed]/laravel/node_modules/laravel-mix/src/components/Vue.js:42:14)
at Vue.webpackConfig ([path-removed]/laravel/node_modules/laravel-mix/src/components/Vue.js:32:14)
at JavaScript.webpackConfig ([path-removed]/laravel/node_modules/laravel-mix/src/components/JavaScript.js:90:22)
at Mix.listen.config ([path-removed]/laravel/node_modules/laravel-mix/src/components/ComponentFactory.js:75:54)
at events.(anonymous function).forEach.handler ([path-removed]/laravel/node_modules/laravel-mix/src/Dispatcher.js:34:47)
at Array.forEach (<anonymous>)
at Dispatcher.fire ([path-removed]/laravel/node_modules/laravel-mix/src/Dispatcher.js:34:28)
at Mix.dispatch ([path-removed]/laravel/node_modules/laravel-mix/src/Mix.js:119:25)
at WebpackConfig.build ([path-removed]/laravel/node_modules/laravel-mix/src/builder/WebpackConfig.js:28:13)
at Object.<anonymous> ([path-removed]/laravel/node_modules/laravel-mix/setup/webpack.config.js:29:38)
at Module._compile ([path-removed]/laravel/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require ([path-removed]/laravel/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at WEBPACK_OPTIONS ([path-removed]/laravel/node_modules/webpack-cli/bin/convert-argv.js:115:13)
at requireConfig ([path-removed]/laravel/node_modules/webpack-cli/bin/convert-argv.js:117:6)
at [path-removed]/laravel/node_modules/webpack-cli/bin/convert-argv.js:124:17
at Array.forEach (<anonymous>)
at module.exports ([path-removed]/laravel/node_modules/webpack-cli/bin/convert-argv.js:122:15)
at yargs.parse ([path-removed]/laravel/node_modules/webpack-cli/bin/cli.js:232:39)
at Object.parse ([path-removed]/laravel/node_modules/yargs/yargs.js:567:18)
at [path-removed]/laravel/node_modules/webpack-cli/bin/cli.js:210:8
at Object.<anonymous> ([path-removed]/laravel/node_modules/webpack-cli/bin/cli.js:500:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> ([path-removed]/laravel/node_modules/webpack/bin/webpack.js:155:2)
I'd appreciate it if anyone can point me to the right direction with this..
Thanks!
To get around this issue I have changed a line in node_modules\laravel-mix\src\components\JavaScript.js:10
from
JavaScript.vueWebpackConfigApplied = false;
to
JavaScript.vueWebpackConfigApplied = true;
this var is being used in line 88, but it's hard for me to understand it:
/**
* Override the generated webpack configuration.
*
* @param {Object} webpackConfig
*/
webpackConfig(webpackConfig) {
if (!JavaScript.vueWebpackConfigApplied) {
this.vue.webpackConfig(webpackConfig);
}
JavaScript.vueWebpackConfigApplied = true;
}
I'm new to Laravel, if there's any other venue to post this issue and have a Laravel dev take a look, please let me know
Please or to participate in this conversation.