Closed anjanesh closed 2 years ago
Have you run "npm run dev" command?
Yes.
I tried a second setup cloning your repo instead of manually doing it from the techvblogs article.
composer install
went fine. But npm install --force
shows warnings when
$ npm install --force
npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @vitejs/plugin-react@2.0.0
npm WARN Found: vite@2.9.14
npm WARN node_modules/vite
npm WARN dev vite@"^2.9.11" from the root project
npm WARN 1 more (laravel-vite-plugin)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer vite@"^3.0.0" from @vitejs/plugin-react@2.0.0
npm WARN node_modules/@vitejs/plugin-react
npm WARN @vitejs/plugin-react@"^2.0.0" from the root project
npm WARN
npm WARN Conflicting peer dependency: vite@3.0.9
npm WARN node_modules/vite
npm WARN peer vite@"^3.0.0" from @vitejs/plugin-react@2.0.0
npm WARN node_modules/@vitejs/plugin-react
npm WARN @vitejs/plugin-react@"^2.0.0" from the root project
npm WARN deprecated @vitejs/plugin-react-refresh@1.3.6: This package has been deprecated in favor of @vitejs/plugin-react
Now http://localhost:8000/ works well showing "How To Install React in Laravel 9 with Vite". So there's some issue with vite's newer version ?
import './App'
has to be import './App.jsx'
in resources/js/app.js
No, you need to replace port 300 to 5173 in app/helper.php
Ahh...Thanks a lot. Didn't realize that npm run dev
changed port number !
When we install vite,
"vite": "^3.0.0"
gets installed by default.I'm getting -
What am I doing wrong ?