TanStack / TanStack/router

Vite HMR blank page when editing `__root.tsx` (Solid SSR)

Open
#6,331 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

package: solid-router package: solid-start
Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Which project does this relate to?

Router

Describe the bug

Editing __root.tsx triggers HMR but renders blank page with client error:

Warning: template2 is not a function

Server-side stack trace:

RunnerError
  at reviveInvokeError (vite/dist/node/module-runner.js:476:64)
  at Object.invoke (vite/dist/node/module-runner.js:549:11)
  at ModuleRunner.getModuleInformation (vite/dist/node/module-runner.js:1086:7)
  at request (vite/dist/node/module-runner.js:1103:83)
  at /src/routeTree.gen.ts:11:1              ← import { Route as rootRouteImport } from './routes/__root'
  at ESModulesEvaluator.runInlinedModule (vite/dist/node/module-runner.js:913:3)
  at ModuleRunner.directRequest (vite/dist/node/module-runner.js:1146:59)
  at ModuleRunner.cachedRequest (vite/dist/node/module-runner.js:1053:73)
  at /src/router.tsx:4:1                           ← import { routeTree } from '~/routeTree.gen'
  at ESModulesEvaluator.runInlinedModule (vite/dist/node/module-runner.js:913:3)

status: 500

HMR works correctly on all other route files.

Your Example Website or App

n/a

Steps to Reproduce the Bug or Issue
  1. Create TanStack Start (Solid) app
  2. pnpm dev
  3. Edit __root.tsx (e.g. change some text)
  4. Observe: Blank page, console shows template2 is not a function
  5. Compare: Edit index.tsx → HMR works fine
Expected behavior

Expected: Either successful HMR or graceful full reload
Actual: Blank page requiring manual refresh

Screenshots or Videos

No response

Platform
  • Router / Start Version: 1.145.11
  • OS: macOS
  • Browser: Chrome
  • Browser Version: 144.0
  • Bundler: Vite
  • Bundler Version: 7.3.0
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated import in routeTree.gen.ts and its use from router.tsx, then inspect the routes/__root.tsx HMR path alongside the Vite module-runner stack trace. Reproduce with pnpm dev by editing __root.tsx, compare with index.tsx, and consider the issue complete when root edits no longer produce a blank page or require a manual refresh.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.