Skip to content

TanStack Start prerender errors without sitemap enabled #5419

@checkerschaf

Description

@checkerschaf

Which project does this relate to?

Start

Describe the bug

The prerender option without a sitemap throws this error:

error during build:
Error: Sitemap is not enabled
    at buildSitemap (file:///Users/jan/code/privat/tests/prerender-no-sitemap/node_modules/@tanstack/start-plugin-core/dist/esm/build-sitemap.js:75:11)
    at postServerBuild (file:///Users/jan/code/privat/tests/prerender-no-sitemap/node_modules/@tanstack/start-plugin-core/dist/esm/post-server-build.js:46:5)
    at async Object.buildApp (file:///Users/jan/code/privat/tests/prerender-no-sitemap/node_modules/@tanstack/start-plugin-core/dist/esm/plugin.js:245:15)
    at async Object.buildApp (file:///Users/jan/code/privat/tests/prerender-no-sitemap/node_modules/vite/dist/node/chunks/dep-Chhhsdoe.js:34251:38)
    at async CAC.<anonymous> (file:///Users/jan/code/privat/tests/prerender-no-sitemap/node_modules/vite/dist/node/cli.js:641:3)

Config:

tanstackStart({
      prerender: {
        enabled: true,
        crawlLinks: false,
      },
      pages: [{path: "/"}],
      sitemap: {
        enabled: false,
      }
    }),

Your Example Website or App

https://github.com/checkerschaf/tanstack-start-prerender-no-sitemap

Steps to Reproduce the Bug or Issue

  1. Install reproduction repo
  2. npm install
  3. npm run build

See the build fail.

Expected behavior

Build should work without errors. Static HTML should be output but no sitemap.xml file.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.132.51
  • OS: macOS
  • Bundler: Vite and Rolldown, same behaviour

Additional context

No response

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