Closed CloudyCity closed 3 years ago
@CloudyCity Hi, Same issue here, the code compiles successfully but nothing shows at http://localhost:8000/, I tried changing the port to something else, ex: 4000, but still nothing. Have you got it working ? any idea?
@sid3r No yet, this killing me serval weeks.
@sid3r I finally figure it out.
If there isn't wds keyword in the output of npm run hot
, that mean the default port already in use, so we should make sure use a unuse port.
webpack.mix.js
:
if (mix.inProduction()) { mix.version(); } else { if (process.env.LARAVUE_USE_ESLINT === 'true') { mix.eslint(); } // Development settings mix .sourceMaps() .webpackConfig({ devtool: 'cheap-eval-source-map', // Fastest for development devServer: { proxy: { '*': 'http://localhost:8000', // proxy to host:port which the 'artisan serve' command will use }, }, });
mix.options({ hmrOptions: { host: 'localhost', port: 8070, // a unuse port }, }); }
2. run `php artisan serve`
```php
$ php artisan serve
Laravel development server started: http://127.0.0.1:8000
npm run hot
$ npm run hot
laravue@0.13.1 hot /Users/lyc/Sites/admin.cps.ggxx cross-env NODE_ENV=development BABEL_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js
ℹ 「wds」: Project is running at http://localhost:8070/ ℹ 「wds」: webpack output is served from http://localhost:8070/ ℹ 「wds」: Content not from webpack is served from /Users/lyc/Sites/admin.cps.ggxx/public ℹ 「wds」: 404s will fallback to /index.html
4. visit `http://localhost:8070`, it should work with hmr.
@CloudyCity Nice fix, I've been reloading the page by myself for two months now, thank you. By the way if you use sanctum or any library that use the domain name, you should update your .env file with the two new URLs, ex: _SANCTUM_STATEFULDOMAINS=127.0.0.1:8000,localhost:8070 .
Description:
When i'm using default config, there isn't
wds
keyword in the output ofnpm run hot
, andHMR
not working.But it works after i change port to
8000
.Althought it works but no so elegant. Any suggestion will be help!
Steps To Reproduce: