Skip to content

Two issues related to staticFunctionMiddleware #7876

Description

@reza55n

Which project does this relate to?

Start

Describe the bug

First

When prerender is disabled, staticFunctionMiddleware must be disabled as well, but right now it's partially disabled: Although no JSON files are created, but requests are still sent to the JSON, instead of the original server function.

Second

When spa is enabled, staticFunctionMiddleware must be enabled as well (as SPA is supposed to be static), but right now it's partially disabled, as described in the previous title.

Complete minimal reproducer

https://github.com/reza55n/tanstack-start-test

Steps to Reproduce the Bug

First

npm install
npm run build
npm run preview

In the browser, open http://localhost:4173/
Open devTools - Network
Navigate to Go about and then back to Go home

You see staticFunctionMiddleware must be disabled but it's partially disabled
(asks JSON which doesn't exist)

Second

Then:

Uncomment the line // spa: {enabled: true}, from vite.config.ts

npm run build
npm run preview

Repeat the navigation steps

You see staticFunctionMiddleware must be enabled but it's partially disabled as well
(asks JSON which doesn't exist)

Expected behavior

Explained above

Screenshots or Videos

No response

Platform

  • Start Version: 1.168.32
  • OS: Windows
  • Browser: Chrome
  • Browser Version: 150
  • Bundler: Vite
  • Bundler Version: 5.2.0

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