router.commitLocation is a no-op on 1.170.36 / router-core 1.171.30, so router.navigate() silently does nothing
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #8560 来自 @00200200 —— 已关闭,未合并
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, react, typescript
- 领域
- backend-api-design, cli, tooling
调研方向
The issue is in router-core's commitLocation function. Start by examining the changes between versions 1.171.29 and 1.171.30 in the router-core package, focusing on commitLocation and navigate methods. The reproducer in the gist shows the exact failing calls. Run the provided repro.mjs to see the no-op behavior, then trace through the commitLocation logic to see why it doesn't update history. Look at the test suite to understand expected behavior.
由索引模型根据 Issue 内容生成。
描述
Which project does this relate to?
Router
Describe the bug
On @tanstack/react-router 1.170.36 with @tanstack/router-core 1.171.30, router.navigate() does nothing at all on a router created programmatically. history.location, latestLocation and state.location all stay on the previous entry, the promise resolves undefined, and state.status is back to idle — so there is no pending navigation to await.
It is not path matching or location building. router.buildLocation({ to: ".", search: (p) => ({ ...p, list: "sexes" }) }) returns the correct /operations?tab=lookup-data&list=sexes on both versions. Passing that straight to router.commitLocation({ ...built, replace: true }) moves history on 1.170.35 and does not on 1.170.36. The regression is on the commit side.
Every navigation shape I tried is affected:
| probe | 1.170.35 | 1.170.36 |
|---|---|---|
to: "." + functional search updater |
applied | no-op |
to: "." + object search |
applied | no-op |
to: "/operations" + functional updater |
applied | no-op |
no to + functional updater |
applied | no-op |
to: "/horses/$id" + params (path change) |
applied | no-op |
Caveat, stated up front: the router in this reproducer is created programmatically and never rendered through RouterProvider. I have not established whether a mounted router is affected. I am reporting it because this shape is how a lot of test suites drive the router, and because the pair of patch releases changes it.
Complete minimal reproducer
https://gist.github.com/NickyTope/bcf0b4e05e194dc3b39406cc45c6783c
Steps to Reproduce the Bug
mkdir tsr-repro && cd tsr-repro
# take package.json and repro.mjs from the gist
npm i @tanstack/[email protected] @tanstack/[email protected]
node repro.mjs # every probe prints NO-OP; history never moves
npm i @tanstack/[email protected] @tanstack/[email protected]
node repro.mjs # every probe prints "applied"
The last two lines of the script isolate it:
buildLocation -> /operations?tab=lookup-data&list=sexes
after commit -> /operations?tab=lookup-data <- 1.170.36
after commit -> /operations?tab=lookup-data&list=sexes <- 1.170.35
Expected behavior
await router.navigate({ ... }) moves the router, as it does on 1.170.35 — history, latestLocation and state.location all reflect the new location. Equivalently, commitLocation applies a location that buildLocation built correctly.
Platform
- OS: Linux (NixOS), x86-64
- Node: 24.20.0
@tanstack/react-router: 1.170.36 (broken) vs 1.170.35 (working)@tanstack/router-core: 1.171.30 (broken) vs 1.171.29 (working)- No bundler or framework involved — plain
node repro.mjs
Additional context
Found because a Renovate patch bump turned a suite red that exists specifically to catch router behaviour changes. Holding at 1.170.35 for now.
- 主要语言
- TypeScript
- 星标
- 15.3k
- 派生
- 1.9k
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 46
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/router 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
Masked navigation drops the first character of the hash each time (__tempLocation hash missing '#')可能已有人在做 @hassanabrar202 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
router-generator: lazy-load Prettier (costs ~300–450ms per build even when formatting is off)可能已有人在做 @Sheraff 于 27 天前认领。 未关闭package: router-generator performance
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
router-generator: sibling `physical()` subtrees in a virtual route config generate duplicate identifiers可能已有人在做 @Sheraff 于 27 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
docs(router): clarify static title fallback in SPA mode可能已有人在做 @Rohan-Dedhia 于 17 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
相似的 Issue
-
[BUG]: Shared links drop the configured basePath on GitHub Pages可能已有人在做 @anshulchikhale30-p 今天认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 条评论 ·
维护者通常 1 天内回复
-
Add: GTrekker未关闭check:passed streams:add
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
维护者通常 1 天内回复
-
area: ui Bug Payload OSS
难度 1/5 1 小时以内 新手友好度 88/100
payloadcms/payload#19839 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
jeanibarz/knowledge-base-mcp-server#1291 ·
维护者通常 1 天内回复