3

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??

1 Answers1

0

I guess you are using reach router navigate. If thats the case, try and use navigate from gatsby.

import { navigate } from 'gatsby'