Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running own instance of the app #298

Closed
Mohan-cloud opened this issue Aug 10, 2020 · 9 comments
Closed

Error while running own instance of the app #298

Mohan-cloud opened this issue Aug 10, 2020 · 9 comments

Comments

@Mohan-cloud
Copy link

Mohan-cloud commented Aug 10, 2020

I was able to login using the anonymous option. But when I visit the http://localhost:8000/app/dashboard link, I get the following error.

Router: Children of Router must have a path or default prop, or be a <Redirect>. None found on element type
function Redirect(props) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( BaseContext.Consumer, null, function (_ref7) { var baseuri = _ref7.baseuri; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement( Location, null, function (locationContext) { return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(RedirectImpl, _extends({}, locationContext, { baseuri: baseuri }, props)); } ); } ); }

@robert-w-gries
Copy link
Contributor

Found a workaround from this thread. Doesn't seem like an ideal solution though

diff --git a/src/pages/app.js b/src/pages/app.js
index e77557f..6d46e70 100644
--- a/src/pages/app.js
+++ b/src/pages/app.js
@@ -9,7 +9,7 @@ import Dashboard from './app/dashboard';
 const App = () => (
   <Wrapper>
     <Router>
-      <Redirect noThrow from="/app" to="/app/dashboard" exact />
+      <Redirect noThrow path="/app" to="/app/dashboard" exact />
       <PrivateRoute path="/app/dashboard" component={Dashboard} />
       <PrivateRoute path="/app/builder/:id" component={Builder} />
       <NotFound default />
diff --git a/src/pages/r.js b/src/pages/r.js
index 5392c59..9cc01d8 100644
--- a/src/pages/r.js
+++ b/src/pages/r.js
@@ -7,7 +7,7 @@ import NotFound from './404';
 const ResumeRouter = () => (
   <Wrapper>
     <Router>
-      <Redirect noThrow from="/r" to="/" exact />
+      <Redirect noThrow path="/r" to="/" exact />
       <ResumeViewer path="r/:id" />
       <NotFound default />
     </Router>

@Mohan-cloud
Copy link
Author

Thanks mate, its working now.

@robert-w-gries
Copy link
Contributor

I don't think the issue should be closed since there isn't a solution yet. The workaround above just bypasses the problem of webpack and the hot loader not working well together.

Here is the relevant Gatsby issue: gatsbyjs/gatsby#11934

The problem is only seen while running the development server. If you use npm run build && npm run serve, the issue isn't seen.

There are two solutions listed in the link above:

  1. Use @hot-loader/react-dom

  2. Use fast-refresh as the hot loader as react-hot-loader is being deprecated. Adding GATSBY_HOT_LOADER=fast-refresh to the .env file is confirmed to work with npm run start

I think solution 2 is the way to go since react-hot-loader is being deprecated.

@Mohan-cloud
Copy link
Author

I prematurely closed the issue, my mistake. I'm new to git and react.

@robert-w-gries
Copy link
Contributor

No worries! The author, @AmruthPillai, can re-open the issue if he wishes.

Thanks for filing the issue in the first place, it helped me realize I wasn't the only one seeing the problem.

@AmruthPillai AmruthPillai reopened this Aug 13, 2020
@AmruthPillai
Copy link
Owner

Will look into this :) Thank you for bringing it to my attention @robert-w-gries and @Mohan-cloud!

@insuusvenerati
Copy link

Setting the default prop in <Redirect noThrow from="/app" to="/app/dashboard" exact default /> fixed the issue for me

@HristovCodes
Copy link
Contributor

Setting the default prop in <Redirect noThrow from="/app" to="/app/dashboard" exact default /> fixed the issue for me

This also fixed it for me.

@AmruthPillai
Copy link
Owner

Closing this in favor of Reactive Resume v3 release.
If you continue to face this issue, please raise a new one and I'll have a look at it as soon as I can.

In the meantime, if you are able to, please consider donating to keep supporting the project: https://www.buymeacoffee.com/AmruthPillai :)

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants