Vue + Laravel 5.4 + Mix - "Cannot Get /" Vue + Laravel 5.4 + Mix - "Cannot Get /" vue.js vue.js

Vue + Laravel 5.4 + Mix - "Cannot Get /"


For anyone that still looking for answers

Add this to a webpack.mix.js file

let mix = require('laravel-mix');mix.webpackConfig({    devServer: {        proxy: {            '*': 'http://localhost:8000'        }    }});

Run the backend server (php artisan serve) and then npm run hot. This will proxy all frontend requests to the backend so files can be processed correctly. More information here

With that said, npm run hot should work without developer modification.

source https://github.com/JeffreyWay/laravel-mix/issues/2057


It seems you're missing the path to cross-env...Try with this:

"dev": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js","watch": "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","hot": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js","prod": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"

I've deleted your "dev": "npm run development", and "prod": "npm run production",. If you want to change commands just change them.

Hope It works.