Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- Open the web app on a server with at least one project that has a source control host.
- Go to
/pull-requests?q=4089using an unquoted numeric value in the URL.
Expected behavior
The pull requests page opens, with the search box holding 4089 or empty.
Actual behavior
The app shows the "Something went wrong" screen: TypeError: (search.q ?? "").trim is not a function.
Cause, from main at 5753207d5:
- The router uses the default search parser (
apps/web/src/router.ts:6, noparseSearch). In router-core 1.171.8,src/qss.tsconverts4089to a number during decoding.src/searchParams.tsthen attemptsJSON.parseon values that remain strings. validateSearchinapps/web/src/routes/_chat.pull-requests.tsxkeepsqonly when it is a string, so its result has noq.- Router-core then builds the match's search as
{ ...parentSearch, ...strictSearch }(@tanstack/router-core1.171.8,src/router.ts~1479–1490). No parent route validates search, so the parent's rawq: 4089survives the spread. Route.useSearch()returnsq: 4089, andconst typedQuery = (search.q ?? "").trim();(same file, ~line 589) throws during render. Lines ~1853 and ~2102 read the same value.
Only q=4089 was reproduced in a browser.
Impact
Minor bug or occasional failure
Version or commit
main @ 5753207 (also at 58d2532)
Environment
Linux dev server (vp run dev --share), headless Chromium 1280×800. @tanstack/react-router 1.170.10, @tanstack/router-core 1.171.8.
Logs or stack traces
TypeError: (search.q ?? "").trim is not a function
at PullRequestsRouteView (_chat.pull-requests-*.js)
at renderWithHooks
at updateFunctionComponent
at beginWorkScreenshots, recordings, or supporting files
None.
Workaround
Open /pull-requests without q. That URL loaded normally in the same browser session. Quoting the value (?q=%224089%22) or entering it through the search box is expected to avoid this error based on the source and a Node parser/serializer check, but neither path was tested in a browser.
Written by Claude Opus 5.5 on behalf of ScottN-PV. Found during an unrelated capture and reproduced by an agent on Linux; no person ran it.
Activity
juliusmarminge commentedon Oct 12, 2026
Note
Grok responding on behalf of Julius.
Confirmed on main, accepting as a low-priority bug. It's an edge case: the app never writes a bare numeric
q. Typing4089in the search box goes throughupdateSearch, and the default serializer quotes it as?q=%224089%22. You only hit this with a hand-edited or hand-shared URL like/pull-requests?q=4089. Still, a malformed URL shouldn't crash the page, and the fix is cheap.The cause matches your report.
router.tsuses the default search parser, which turns4089into a number.validateSearch(_chat.pull-requests.tsx~L335) drops non-stringq, but the raw parent search still carriesq: 4089, so(search.q ?? "").trim()(~L589) throws. The reads at ~L1853 and ~L2102 get the same value.Possible fix: coerce
qwithString(...)wherever it's read, or read it only from the validated search.Workaround: use the search box, or quote the value (
?q=%224089%22).