FascistDonut's avatar

Laravel Mix rule.loader problem after migrating site to new server

I created a new server and want to migrate my existing laravel application to it.

I got the database cloned and I used git to clone the source files.

I ran composer install and then npm install. Npm install took a few runs plus some audit fix passes, but eventually seemed to complete successfully after I installed cross-env and webpack.

Now, it is giving me a rule.load.find( is not defined error.

"

@ watch /var/www/html/db1 node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

/var/www/html/db1/node_modules/laravel-mix/src/components/Vue.js:43 rule.loaders.find( ^

TypeError: Cannot read property 'find' of undefined at updateCssLoader.rule (/var/www/html/db1/node_modules/laravel-mix/src/components/Vue.js:43:26) at Vue.updateCssLoader (/var/www/html/db1/node_modules/laravel-mix/src/components/Vue.js:91:21) at Vue.updateCssLoaders (/var/www/html/db1/node_modules/laravel-mix/src/components/Vue.js:42:14) at Vue.webpackConfig (/var/www/html/db1/node_modules/laravel-mix/src/components/Vue.js:32:14) at JavaScript.webpackConfig (/var/www/html/db1/node_modules/laravel-mix/src/components/JavaScript.js:90:22) at Mix.listen.config (/var/www/html/db1/node_modules/laravel-mix/src/components/ComponentFactory.js:75:54) at events.(anonymous function).forEach.handler (/var/www/html/db1/node_modules/laravel-mix/src/Dispatcher.js:34:47) at Array.forEach () at Dispatcher.fire (/var/www/html/db1/node_modules/laravel-mix/src/Dispatcher.js:34:28) at Mix.dispatch (/var/www/html/db1/node_modules/laravel-mix/src/Mix.js:119:25) at WebpackConfig.build (/var/www/html/db1/node_modules/laravel-mix/src/builder/WebpackConfig.js:28:13) at Object. (/var/www/html/db1/node_modules/laravel-mix/setup/webpack.config.js:29:38) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) "

0 likes
1 reply
FascistDonut's avatar

I ended up resolving this by just zipping the entire folder (with node_modules) from the previous server, then unzipped it on the new server and fixed permissions. Still no idea what that error was about.

Please or to participate in this conversation.