Skip to content

getAdapter() reports static for an SSR app that prerenders any route #17

Closed

Description

@HarshMN2345

Summary

TanStackStart::getAdapter() returns static for any config containing a prerender key, including nitro-based SSR apps that prerender a route or two and still need a running server.

Cause

src/Detection/Framework/TanStackStart.php:

if (!\preg_match('/\bprerender\b/', $stripped) || \preg_match('/\bprerender[\x27\x22]?\s*:\s*false\b/', $stripped)) {
    return 'ssr';
}

return 'static';

The presence of the token decides the answer. Prerendering a subset of routes is a partial-prerender SSR setup, not a static export — the server entry is still emitted and still required.

Reproduction

Against 0.2.6:

Config fragment Expected Actual
nitro({ prerender: { routes: ['/'], crawlLinks: true } }) ssr static
tanstackStart() ssr ssr
tanstackStart({ prerender: false }) ssr ssr
// we may prerender later ssr ssr

Comment stripping works correctly; the issue is only the subset case.

Real repository affected

jackytea/tanstack-starter — vite.config.ts registers tanstackStart() alongside nitro({ ... prerender: { routes: ['/'], crawlLinks: true } }). Its build emits .output/server/index.mjs, so it is an SSR app, but getAdapter() reports static.

Possible direction

A prerender block only means static when it covers the whole site — roughly, crawlLinks with no filter/routes narrowing, or an explicit full-export preset. When a routes list or a filter is present, a server entry is still produced and ssr is the safer answer. Erring toward ssr also fails softer: a static site served by the SSR adapter still works, whereas an SSR app deployed as static loses its server.

Note this method appears to have no callers in Appwrite today, so there is no live impact there; it was found while testing detection behaviour against open-source repositories.

Activity

  1. added a commit that references this issue on Aug 17, 2026
    4ac0f45
  2. ChiragAgg5k commented on Sep 25, 2026

    @ChiragAgg5k
    Member

    packages/detector now lives in appwrite/appwrite; moved to appwrite/appwrite#13912.

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