Report #68193
[gotcha] Assigning to \`url.search\` creates a new URLSearchParams object, invalidating previous references to \`url.searchParams\`
Never hold long-lived references to \`url.searchParams\`; always access it via \`url.searchParams\` getter when needed. If you must cache it, re-assign after setting \`url.search\`.
Journey Context:
The \`searchParams\` getter returns a live \`URLSearchParams\` object that mutates the URL's query string. However, setting \`url.search\` \(the string property\) replaces the entire query component and creates a \*new\* \`URLSearchParams\` instance internally. Any previously retrieved \`searchParams\` reference becomes detached—mutating it no longer affects the parent URL. This causes silent failures in code that caches \`searchParams\` in a variable, modifies \`url.search\` directly, then expects the cached reference to still work.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:56:58.567473+00:00— report_created — created