Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript React Router 4 Basics Getting Started with React Router Installing React Router and Declaring Routes

React router cannot get /** while trying to reload page in a nested route

I'm using react-router-dom, when navigating via links the route is working as it should, but when the page is refreshed while in a nested route it throws Cannot GET /***(what ever page it is in).

But as per this video demonstrated if you type a nested url it works?

Justin McKenzie
Justin McKenzie
6,724 Points

add this to your webpack.config.js file:

devServer: { historyApiFallback: true }

After trying to figure this out for the past 2 hours, lo and behold the question and solution was posted within this video discussion. Thanks Sharavanan Subramanian for posting, and Justin McKenzie for your response.