lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

getStaticPaths() with `undefined` slug creates actual "/undefined" route

Open ttntm opened this issue 3 years ago • 0 comments

What version of astro are you using?

1.2.4, 1.2.6

Are you using an SSR adapter? If so, which one?

none yet

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

Following the docs (https://docs.astro.build/en/core-concepts/routing/#example-dynamically-create-a-top-level-root-page) and #3990 (https://github.com/withastro/astro/issues/3990#issuecomment-1211216446) to create a top level root page via undefined slug renders an actual "/undefined" route.

Happens on localhost, just the same way as in the linked repro at https://withastro-astro-zoqwkc--3000.local-corp.webcontainer.io/undefined

The /undefined route can certainly be worked around using HTTP redirects in production, but generating it is probably not what should be happening in the first place.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-zoqwkc?file=src/pages/[...slug].astro

Participation

  • [ ] I am willing to submit a pull request for this issue.

ttntm avatar Sep 18 '22 17:09 ttntm