Skip to content

devserver serves source files instead of index.html since v7.0.5 #20705

@schiller-manuel

Description

@schiller-manuel

Describe the bug

Since version 7.0.5, vite devserver serves source files instead of index.html when the url path matches the basename of a file inside the project.

originally reported here: TanStack/router#5052

Reproduction

https://stackblitz.com/edit/vitejs-vite-sfcqpwnb

Steps to reproduce

  1. go to https://stackblitz.com/edit/vitejs-vite-sfcqpwnb
  2. click on "open preview in new tab"
  3. click on "click me" that opens the dev server at /test
  4. you will see the contents of test.js served from /test

here is the same project with vite 7.0.4 that works as expected:
https://stackblitz.com/edit/vitejs-vite-tgbe56vv

System Info

starts happening since vite 7.0.5

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: devdev serverp3-minor-bugAn edge case that only affects very specific usage (priority)regressionThe issue only appears after a new release

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions