Bug in the future: routing implementation not compatible with react-router 5.1.2
Describe the bug when the page loads and the user is not logged in, the page loads to /welcome and gives an error message 'Something went wrong', and throws an error: Uncaught Invariant Violation: You should not use <Redirect> outside a <Router>
To Reproduce Steps to reproduce the behavior:
- npm install [email protected]
- npm start
- See error
Expected behavior /welcome should redirect to /login and show the login page
Desktop (please complete the following information):
- OS: Windows 10
- Browser Chrome
- Version 79.0.3945.130 (Official Build) (64-bit)
Additional context After some investigation i've narrowed it down to Private Layout loosing the context of the Router but I can't find futher avenues of investigation because the error occurse in the validation code of react-router. this is the callstack:
in jl (created by t)
in t (created by WithWebId(t))
in WithWebId(t) (at routes.js:87)
in Switch (at routes.js:81)
line 87 is the Private Layout component
Thanks for the heads up on this future issue. As upgrading from react-router-dom v4 to v5 may cause some breaking changes, we will be include this fix in an upcoming release.