vite: When I start using vite, the page shows 404
Describe the bug
when I start use npm run dev
, the page shows me 404 but no error
// package.json
{
"dev": "vite",
}
Reproduction
this is my link
https://github.com/HuskyToMa/vue3Component
System Info
vite
version: 1.0.0-rc.9
node
version: 12.16.1
system
: macOS 10.15.3
Optional:
npm
version: 6.13.4
vue
version: 3.0.2 from pacakge-lock.json
@vue/compiler-sfc
version: 3.0.2
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (3 by maintainers)
thanks for this, unfortunately we have a big project, multiple project references with typescript, tooling etc. copying into one src is a bit problematic. I have managed to get vite working, works well, just seems when i update to the head version now
@vitejs/plugin-vue
has an explicit peer dependency to vue3 that wasn’t there before.Don’t know if it’s relevant here, but I got 404 when starting up the dev server. The problem was that in
vite.config.js
, I had defined this since earlier:because I’m currently migrating my build to vite from Vue2 webpack template (
vue init webpack
), which historically has had that ruled defined to be able to doimport Menu from @/components/Menu
.It made the script
@vite/client
not resolve. I removed this part of the config, find-replaced all @ with src manually and added .vue and .js to all imports, and vite started working again.