TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
8.15k stars 635 forks source link

Using special characters in URLs causes 100% CPU usage and causes pages to fail to load #2053

Closed jonreading81 closed 3 months ago

jonreading81 commented 3 months ago

Describe the bug

When upgrading to the latest version the Tanstack router an issue was discovered where by the browser would max out the CPU when special characters are used in the URL. This is only an issue when the URL is accessed directly not through client side routing and a beforeLoad method is provided to the root route.

Your Example Website or App

https://stackblitz.com/edit/vitejs-vite-ymskas

Steps to Reproduce the Bug or Issue

Goto https://vitejsviteymskas-ogdh-iqwsx4wk--5173--41692973.local-credentialless.webcontainer.io/ Click on ΚΑΠΠΑ The CPU goes to 100% usage

Expected behavior

As a user I expect the page to load and the post id to be displayed

Screenshots or Videos

No response

Platform

Additional context

No response

jonreading81 commented 3 months ago

It looks like this became an issue in 1.45.3. Although some behaviour also changed in 1.45.2 where the context in the beforeLoad method was empty on URLS s with special characters causing a different error in our codebase.