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

Warning and blank page when using withRouteData on homepage in 5.7.6 #567

Closed
benedfit opened this issue Apr 16, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@benedfit
Copy link
Contributor

commented Apr 16, 2018

I upgrade to 5.7.6 and when the app is hydrated in production I am warned about using withRouteData on the homepage. This results in the page being rendered as a blank page. Loading a child page, and then navigating back to the homepage works as expected, but refreshing the homepage produces the error again

@tannerlinsley

This comment has been minimized.

Copy link
Collaborator

commented Apr 16, 2018

@benedfit

This comment has been minimized.

Copy link
Contributor Author

commented Apr 17, 2018

https://github.com/avaclancheuk/destiny-clan-warfare

I have since downgraded back to 5.7.1

stilva pushed a commit to stilva/react-static that referenced this issue Apr 18, 2018

stilva pushed a commit to stilva/react-static that referenced this issue Apr 18, 2018

@stilva

This comment has been minimized.

Copy link

commented Apr 18, 2018

Reproduced the above based on examples/basic here: 1a22b4a, then run npm run build && npm run serve

When hydrating, window.__routeInfo.path === path fails becausewindow.__routeInfo.path === "/" while path === ""

I'm not familiar enough with this project, so I'm not sure when cleanPath returning a falsy value is useful, but 16fc14b seems to fix this issue.

stilva pushed a commit to stilva/react-static that referenced this issue Apr 18, 2018

stilva pushed a commit to stilva/react-static that referenced this issue Apr 18, 2018

@stilva

This comment has been minimized.

Copy link

commented Apr 20, 2018

@benedfit v5.8.1 fixed this issue for me. Thanks for the fix @tannerlinsley! 🎉

@benedfit

This comment has been minimized.

Copy link
Contributor Author

commented Apr 20, 2018

I’ll try upgrading again and let you know how I get on

@tannerlinsley

This comment has been minimized.

Copy link
Collaborator

commented Apr 24, 2018

Should be fixed in latest version

@efarem

This comment has been minimized.

Copy link

commented May 4, 2018

I'm seeing this error when serving prod bundles on version 5.9.1. To reproduce just hit a route thats using the withRouteData HOC with index.html on the end.

Repro steps:

  • react-static create (use basic)
  • yarn build
  • yarn serve
  • Hit http://localhost:3000/blog/index.html

Exact error: RouteData or withRouteData couldn't find any props for path: blog/index.html. You are either missing a route.getData function or you are relying on RouteData/withRouteData where you don't need to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.