Skip to content

Query params trigger 404 error in dev #15095

@grundmanise

Description

@grundmanise

Astro Info

Astro                    v5.16.6
Vite                     v6.4.1
Node                     v24.12.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/solid-js (v5.1.3)
                         @astrojs/sitemap (v3.6.0)

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

No response

Describe the Bug

When trailingSlash is set to anything other than ignore, query params cause a 404 page in dev mode.

Reproduction steps:

  1. Set the base path in the config
  2. Set trailingSlash to never
  3. Navigate to the index page (now at the base path) – works fine
  4. Add query params to the URL and refresh – results in a 404 error

What's the expected result?

Page loads fine

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-svbaysc1?file=astro.config.mjs

Participation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P4: importantViolate documented behavior or significantly impacts performance (priority)feat: routingRelated to Astro routing (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions