menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Gatsby

Fast in every way that matters. Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps.

Channels
Team

Gatsby client routes go to 404 in development environment

March 30, 2021 at 7:10pm

Gatsby client routes go to 404 in development environment

March 30, 2021 at 7:10pm (Edited 1 year ago)
I am working on a gatsby hybrid app that has several client-only routes with dynamic server data. Strangely when navigating to one of the client-only routes at I am getting the 404 page and the message that there is no page found.
Visiting the client-only URL directly, eg. mysite/auth/login, works, and the issue only happens when using an internal Link component or navigate('/auth/login').
Screen Shot 2021-03-30 at 3.01.51 PM.png
I am using the gatsby-plugin-create-client-paths setup
Screen Shot 2021-03-30 at 3.02.45 PM.png
and Router component to handle the client-routing
Screen Shot 2021-03-30 at 3.02.59 PM.png
I am have tried different approaches but couldn't figure out why I am being redirected to the 404 page. The issue happens only on the inial page visit. Once the page has been loaded internal navigation works without errors and also only happens in development mode. The production build works just fine.
Any ideas what could cause this behavior??

March 30, 2021 at 7:42pm
I have the same problem