Repository navigation
vite+ refuses to run dev server in root package of monorepo if index.html is not in root #2516
Copy link
Copy link
Closed
Description
Describe the bug
when running vp dev in the root package of a monorepo, if the index.html is not in the root directory (e.g. via setting the root option in the vite config), then vp dev shows a prompt box asking you which package you intended to run the dev server for.
vite does not exhibit the same behaviour, instead it correctly discovers the index.html and starts a dev server.
Reproduction
https://github.com/solonovamax/vite-plus-dev-src-index-reproduction
Steps to reproduce
pnpm installpnpm dev
vite+ prompts you to "Select a package to dev"
System Info
vp env current: cannot run, see: #2515
here's envinfo instead, if it helps:
$ pnpx envinfo
System:
OS: Linux 7.1 Arch Linux
CPU: (8) x64 AMD Ryzen 7 4700U with Radeon Graphics
Memory: 22.25 GB / 62.17 GB
Container: Yes
Shell: 5.3.15 - /bin/bash
Binaries:
Node: 26.4.0 - /home/solonovamax/.nvm/versions/node/v26.4.0/bin/node
pnpm: 11.22.0 - /home/solonovamax/.nvm/versions/node/v26.4.0/bin/pnpm
bun: 1.3.14 - /usr/bin/bun
Deno: 2.9.3 - /usr/bin/deno
Managers:
Cargo: 1.97.1 - /usr/bin/cargo
Gradle: 9.6.1 - /usr/local/bin/gradle
Maven: 3.9.16 - ~/.sdkman/candidates/maven/current/bin/mvn
pip3: 26.1.2 - /usr/bin/pip3
Utilities:
7z: 26.02 - /usr/bin/7z
CMake: 4.4.0 - /usr/bin/cmake
Make: 4.4.1 - /usr/bin/make
GCC: 16.1.1 - /usr/lib/ccache/bin/gcc
Git: 2.55.0 - /usr/bin/git
Git LFS: 3.7.1 - /usr/bin/git-lfs
Clang: 22.1.8 - /usr/lib/ccache/bin/clang
Ninja: 1.13.2 - /usr/bin/ninja
Mercurial: 7.2.3 - /usr/bin/hg
Subversion: 1.14.5 - /usr/bin/svn
FFmpeg: 8.1.2 - /usr/bin/ffmpeg
Curl: 8.21.0 - /usr/bin/curl
OpenSSL: 3.6.3 - /usr/bin/openssl
ccache: 4.13.6 - /usr/bin/ccache
Calibre: 9.11.0 - /usr/bin/calibre
Servers:
Apache: 2.4.68 - /usr/bin/apachectl
Nginx: 1.30.3 - /usr/bin/nginx
Virtualization:
Docker: 29.6.2 - /usr/bin/docker
Docker Compose: 5.3.1 - /usr/bin/docker-compose
IDEs:
Nano: 9.1 - /usr/bin/nano
VSCode: 1.127.0 - /usr/bin/code
Vim: 9.2 - /usr/bin/vim
Languages:
Bash: 5.3.15 - /usr/bin/bash
Go: 1.26.5 - /usr/bin/go
Java: 25.0.3 - /home/solonovamax/.sdkman/candidates/java/current/bin/javac
Perl: 5.42.2 - /usr/bin/perl
Protoc: 35.1 - /usr/bin/protoc
Python: 3.14.6 - /usr/bin/python
Python3: 3.14.6 - /usr/bin/python3
R: 4.6.1 - /usr/bin/R
Rust: 1.97.1 - /usr/bin/rustc
Databases:
MySQL: 15.2 (MariaDB) - /usr/bin/mysql
PostgreSQL: 18.4 - /usr/bin/postgres
SQLite: 3.53.3 - /usr/bin/sqlite3
Browsers:
Chromium: 150.0.7871.124note: the "browsers" is incorrect. see: tabrindle/envinfo#303
$ pnpm vp --version
VITE+ - The Unified Toolchain for the Web
vp v0.2.9
Local vite-plus:
vite-plus v0.2.9
Tools:
vite v8.2.1
rolldown v1.2.3
vitest v4.1.10
oxfmt v0.62.0
oxlint v1.77.0
oxlint-tsgolint v7.0.2001
tsdown v0.22.14Used Package Manager
pnpm
Logs
Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Fields
Priority
None yet
Activity
solonovamax commentedon Aug 20, 2026
Also related, in a monorepo where the root package is the application and which does not have
index.htmlin the root, the dev server will open a prompt to select which package to run the dev server for, and the root package is not in that list.this is likely due to the following:
vite-plus/packages/cli/binding/src/cli/app_target.rs
Lines 156 to 203 in fc32f3c
I don't feel like making a separate reproduction sample for this, so instead I'm just posting it as a comment.
See: #770
Caused by: #2031
solonovamax commentedon Aug 20, 2026
My current workaround to this issue is to symlink the index.html into the project root.
I have my index.html under
srcbecause I personally find that it helps clean things up, so the symlink is only a temporary measure until this is fixed.jong-kyung commentedon Aug 21, 2026
This is expected Vite behavior rather than a Vite+ bug. Since index.html is under src, set root: "src" in
vite.config.ts: https://vite.dev/config/shared-options#rootliangmiQwQ commentedon Aug 21, 2026
Hi, this is a separate problem, could you please submit a separate issue for that?
solonovamax commentedon Aug 21, 2026
iirc I do actually have that in the project where I encountered it, but I'll double check in five minutes
solonovamax commentedon Aug 21, 2026
sorry, that took a bit, but I checked and in the repository where I encountered it I had
rootset to"src"would I need to provide a reproduction sample for this? because it takes like 10-15 minutes to make a reproduction sample every time
liangmiQwQ commentedon Aug 21, 2026
@solonovamax You can set https://github.com/liang-demos/vite-plus-root-app-picker-repro as the reproduction url, and you can also directly commit to this repo if you think there is something doesn't matches your idea.
solonovamax commentedon Aug 22, 2026
okay, from some further testing, I have discovered that my initial assumptions were false. vite+ exhibits the same behaviour as vite does in all these scenarios, except for one: when running
vp devin a monorepo where the root project is the app and theindex.htmlis not present in the root directory.vite-plus instead presents the picker which gave me the false impression that I should instead run
vp dev ., which does not work because I should have instead runvp dev src/(vite exhibits the same behaviour as vite+ if I runvite dev .instead ofvite dev src/.rather than creating a separate issue, I'm going to modify the current issue & the reproduction sample
Update reproduction sample
[-]dev server is broken when index.html is not in root[/-][+]vite+ refuses to run dev server in root directory if index.html is not in root[/+][-]vite+ refuses to run dev server in root directory if index.html is not in root[/-][+]vite+ refuses to run dev server in root package of monorepo if index.html is not in root[/+]solonovamax commentedon Aug 22, 2026
updated the sample & the issue, the other repository is no longer necessary
fengmk2 commentedon Aug 22, 2026
@solonovamax It should be a bug, I will fix it soon.
fix(cli): improve workspace app target classification (voidzero-dev#2530