-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Labels
Description
What version of React Router are you using?
6.6.0
Steps to Reproduce
Create data router using createMemoryRouter(...) and <RouterProvider ...>, use redirect() or navigate() in environment that it neither test env nor a browser.
Expected Behavior
Internal current route should change to the one provided in redirect() or navigate() (as it currently does when using <MemoryRouter>).
Actual Behavior
An error is being thrown:
ReferenceError: window is not defined
at createClientSideURL (/home/yiin/projects/wicked/node_modules/@remix-run/router/history.ts:570:9)
at createClientSideRequest (/home/yiin/projects/wicked/node_modules/@remix-run/router/router.ts:2900:13)
at startNavigation (/home/yiin/projects/wicked/node_modules/@remix-run/router/router.ts:959:19)
at Object.navigate (/home/yiin/projects/wicked/node_modules/@remix-run/router/router.ts:859:18)
jmezzacappa and Domenico-Esposito