-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Description
Reproduction
- Navigate to https://stackblitz.com/edit/github-chzf5vkt
- Click "Broken" (routing error occurs)
- Refresh Stackblitz app
- Click "Not Broken" (no routing error)
System Info
Note that while the following are what I'm running on my local machine, this bug is reproducible with any version of react-route at or above v7.9.6 (using react 18 or 19).
System:
OS: macOS 26.1
CPU: (10) arm64 Apple M1 Pro
Memory: 275.95 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.18.0
npm: 11.5.2
bun: 1.3.5
Watchman: 2025.12.15.00
Browsers:
Chrome: 143.0.7499.171
Safari: 26.1
npmPackages:
react-router: 7.9.6 => 7.9.6
vite: ^7.3.0 => 7.3.1Used Package Manager
bun/npm
Expected Behavior
When calling navigate({ pathname: 'my-path:with-colon' }, { replace: true });, RR should navigate to that path relative to the current location (versions prior to 7.9.6 allowed this)
Actual Behavior
When calling navigate({ pathname: 'my-path:with-colon' }, { replace: true });, RR errors.
Must use navigate({ pathname: './my-path:with-colon' }, { replace: true }); to fix.
When running on my machine, I get:
Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'my-path:with-colon' cannot be created in a document with origin 'http://localhost:3000' and URL 'http://localhost:3000/';
When running in stackblitz, I seem to get:
No routes matched location "with-colon"
Unsure of why they are different, though locally my app is only client-side with Declarative routing, and the example is server side with framework routing.