Skip to content

Dashboard returns 500 on every request: "matchedRoutes is not iterable" (TanStack router version drift) #19

Open

Description

@nimrc

Summary

With a fresh npx agentmind-cli claude (v0.3.0), every dashboard request on http://127.0.0.1:8088 returns 500 (including /favicon.ico). The proxy (POST /v1/messages) keeps working, so only the UI is broken.

Response body:

{"status":500,"unhandled":true,"message":"HTTPError"}

Server log (~/.agentmind/logs/claude-*.log), once per request:

ERROR: HTTPError: matchedRoutes is not iterable

Cause

dist/server/server.js bundles TanStack Start's server core, but @tanstack/react-router (and so @tanstack/router-core) stays external and resolves from the ^1.167.0 range at install time.

The bundled handler destructures an object:

// dist/server/server.js:4837
const { matchedRoutes, foundRoute, routeParams } = router.getMatchedRoutes(pathname);
for (const route of matchedRoutes) { // throws

The router-core that npx installs now returns a tuple:

// @tanstack/router-core@1.171.39 dist/esm/router.js:239
this.getMatchedRoutes = (pathname) => {
  ...
  return [match?.branch || [this.routesById["__root__"]], rawParams, match?.route];
};

So matchedRoutes is undefined and every SSR request throws.

Resolved versions in the npx install:

package version
agentmind-cli 0.3.0
@tanstack/react-router 1.170.46
@tanstack/router-core 1.171.39
@tanstack/react-start 1.169.4
@tanstack/start-server-core 1.169.45
@tanstack/react-start-server 1.167.52

Node v26.11.1, macOS.

Repro

npx agentmind-cli claude
curl -i http://127.0.0.1:8088/   # 500

Suggested fix

Either pin the TanStack packages to exact versions (or ship a lockfile-equivalent via bundleDependencies), or bundle @tanstack/react-router / router-core into dist/server so the server build can't drift from the router it was compiled against.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions