withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.27k stars 2.44k forks source link

cannot dev or preview a page, if the page filename contain 'index', eg. e-index.astro #10850

Closed jasper2virtual closed 5 months ago

jasper2virtual commented 5 months ago

Astro Info

Astro                    v4.6.3
Node                     v18.18.2
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I create a page e-index.astro, and the astro config is build.format:"preserve"

In dev mode or preview mode, the 'e-index.html' page cannot found. But it can build successfully.

sample code : https://github.com/jasper2virtual/astroissue/tree/main/src/pages

What's the expected result?

in dev mode, to load the page e-index.html in browser

Link to Minimal Reproducible Example

n/a

Participation

github-actions[bot] commented 5 months ago

Hello @jasper2virtual. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

jasper2virtual commented 5 months ago

Yes, I have a GitHub repo, that can reproduce the problem. Here it is https://github.com/jasper2virtual/astroissue
This is a Astrojs project, you can reproduce the problem :

  1. npm run dev

  2. use browser to visit http://localhost:4321/e-index.html

  3. Then the browser show 404 error

    image
  4. And it is weird that it show the page at http://localhost:4321/e-index/index.html

    image
  5. But the e-index.html can be built successfully, after 'npm run build'

    image image image