Skip to content

Adapter static does not export an index.html for root redirect #2541

@ecstrema

Description

@ecstrema

Describe the bug

When using adapter static with a redirect server root, no root index.html is exported.

This results in a 404 error when fetching the root index.html, instead of redirecting to the wanted location.

src/

  • routes/
    • index.ts --> this one redirects to en/index.svelte
    • en/
      • index.svelte

What happens:

No root index.html is created when exporting with adapter static.

That is normal, since server routes are simply ignored, but :

What i'd like

  1. Emit a warning about using adapter static with a repo that has server routes.
  2. // MAYBE?? Provide a better way to use redirect routes

Workaround

replace index.ts with index.svelte and put the script content in <script context="module>

Reproduction

coming soon

Logs

No response

System Info

Github Pages

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp3-edge-caseSvelteKit cannot be used in an uncommon way

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions