generator-solid-react icon indicating copy to clipboard operation
generator-solid-react copied to clipboard

Bug in the future: routing implementation not compatible with react-router 5.1.2

Open michaud opened this issue 5 years ago • 1 comments

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:

  1. npm install [email protected]
  2. npm start
  3. 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

michaud avatar Jan 28 '20 20:01 michaud

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.

brownhoward avatar Jan 30 '20 16:01 brownhoward