Gatsby: [2.9.x] Client only paths refresh stopped working

Created on 12 Jun 2019  路  8Comments  路  Source: gatsbyjs/gatsby

Hi,
from the 2.9.0 version if I try to navigate directly to one of client page path like "/product/123/", I'm redirected to the base "/product/" url: the same if I refresh the browser from the "/product/123/" page.

bug

Most helpful comment

Fixed and published in [email protected]

All 8 comments

I made a demo site here:

https://csb-ith0t.netlify.com/test/product/

navigate to one of single product page and refresh it... you'll redirect to the previous list page.

The issue happen in production build only!

I try to update to the latest 2.9.3 version but it's the same: I think is due to the new page-data.json that, for the client only routes, set a wrong path on it:

{"componentChunkName":"component---src-pages-test-product-js","path":"/test/product/","webpackCompilationHash":"45138510e055c8cebbcf","result":{"pageContext":{"matchPath":"/test/product/*","isCreatedByStatefulCreatePages":true}}}

@valse can we reproduce it with https://github.com/gatsbyjs/gatsby/tree/master/examples/client-only-paths?

Thanks for filling this bug

Hi @wardpeet... I reproduced it in this codesandbox and published to netlify (I added the gatsby-plugin-netlify to support the client redirect on Netlify, and the gatsby-plugin-create-client-paths one instead of using the gatsby-node config for the client routing).

If you refresh one of next pages, it will be redirected to the first one.

any workaround on this ?

Sorry for the inconvenience. The only workaround is to lock gatsby on version 2.8.8.

Fixed and published in [email protected]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theduke picture theduke  路  3Comments

mikestopcontinues picture mikestopcontinues  路  3Comments

ferMartz picture ferMartz  路  3Comments

brandonmp picture brandonmp  路  3Comments

KyleAMathews picture KyleAMathews  路  3Comments