Skip to content

Root path "/" is missing prerendered HTML file and is excluded from sitemap.xml when using SPA mode #8741

Open

Description

@jonathanpotts

Which project does this relate to?

Start

Describe the bug

These issues occur when using SPA mode:

  • Root path "/" is missing prerendered HTML file:
    • The build tool shows: [prerender] - / but dist/client/index.html is missing.
    • For comparison, for [prerender] - /about there is a dist/client/about/index.html file.
  • Root path "/" is excluded from sitemap.xml:
    • The build tool creates dist/client/sitemap.xml but the <url /> for / is missing.
    • The dist/client/pages.json file claims that the path is excluded from the sitemap.

Complete minimal reproducer

https://github.com/jonathanpotts/start-spa-prerender-root-repro

Steps to Reproduce the Bug

  1. Create a new TanStack Start project by running: npx @tanstack/cli@latest create --non-interactive --no-intent project-name
  2. Edit vite.config.ts and add the following configuration for the tanstackStart plugin:
 {
  spa: {
    enabled: true,
    prerender: {
      enabled: true,
    },
  },
  prerender: {
    enabled: true,
  },
  sitemap: {
    host: 'https://localhost:3000',
  },
}
  1. Run npm run build
  2. Observe that dist/client/index.html is missing and the <url /> for / is missing from dist/client/sitemap.xml

Expected behavior

After running npm run build:

  • There is a dist/client/index.html file which contains the static prerender for the / route
  • There is a <url /> entry for / in dist/client/sitemap.xml

Screenshots or Videos

No response

Platform

  • Start Version: 1.169.3
  • OS: Windows
  • Browser: N/A
  • Browser Version: N/A
  • Bundler: vite
  • Bundler Version: 8.3.4

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions