10
4

More than 1 year has passed since last update.

Windows wsl2でSailを使ってLaravelをインストール後、BreezeでReactの導入をした時のエラー

Last updated at Posted at 2022-07-11

経緯

これに従ってLaravelをインストールし、
https://laravel.com/docs/9.x/installation#getting-started-on-windows

これに従ってReactをインストールし、
https://laravel.com/docs/9.x/starter-kits#laravel-breeze

npm run dev実行後、http:localhostにアクセスすると真っ白の画面となり、コンソールには
Failed to load resource: net::ERR_ADDRESS_INVALID 0.0.0.0:5173/@vite/client:1
というエラーが出ていました。自分用のメモ程度ですが、解決策を示しておきます。

解決策

原因は、Githubのissueの中で見つかりました。https://github.com/laravel/vite-plugin/issues/28

こちらに従って、npm run dev実行後、public/hotのファイルの0.0.0.0
localhostに変更することで解決しました。

こちらLaravel9自体のバグらしく、次のアップデートで解決されるようです。
https://github.com/laravel/vite-plugin/pull/42

10
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
4