Skip to content

πŸ› TanStack Start + Cloudflare + Paraglide JS == HELLΒ #6268

@luthfi-hh

Description

@luthfi-hh

Which project does this relate to?

Start

Describe the bug

Locale redirect bug: navigating to /de immediately redirects to /en (cannot switch language)

Description

Repro repo

Problem
When I try to switch the app language to German (/de), it immediately redirects back to English (/en). Even if I manually type /de in the URL, it redirects to /en, so I can’t use the de locale at all.

Steps to reproduce

  1. Start the app (e.g. pnpm dev).
  2. Open http://localhost:3000/de (or click a language switcher button that navigates/sets locale to de).
  3. Observe the URL changes back to /en immediately.

Expected behavior

  • Visiting /de stays on /de.
  • The UI renders German messages and getLocale() (or equivalent) resolves to de.

Actual behavior

  • /de always redirects to /en immediately.
  • Language cannot be changed to German.

Relevant code / suspicion

  • Suspicion: when running with Cloudflare + Vite dev, src/server.ts does not seem to be executed, so the Paraglide middleware (paraglideMiddleware) never runs.

Environment

  • OS: macOS
  • Date: 2026-01-02
  • Package manager: pnpm
  • Dev server: Vite / TanStack Start + Cloudflare
  • Locales configured: en, de

Extra notes

  • This happens even when the URL already includes /de, so it’s not just missing-locale auto-redirect from / β†’ /en.

Your Example Website or App

https://github.com/luthfi-hh/tanstack-start-hell

Steps to Reproduce the Bug or Issue

  1. Start the app (e.g. pnpm dev).
  2. Open http://localhost:3000/de (or click a language switcher button that navigates/sets locale to de).
  3. Observe the URL changes back to /en immediately.

Expected behavior

Visiting /de stays on /de.
The UI renders German messages and getLocale() (or equivalent) resolves to de.

Screenshots or Videos

No response

Platform

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