Redirect when using gatsby-source-prismic-graphql with pathprefix in gatsby

Hi there,

We built our site with this plugin (gatsby-source-prismic-graphql) before its deprecation was announced, and are trying to move forward with this plugin. We are serving the site using gatsby's pathprefix and assetprefix option to add the path prefix '/blog' to all pages. All the pages on our site work except for any pages for posts generated by that plugin. The site navigates correctly to /blog/:uid/, but then redirects to just /:uid/, which causes all sorts of issues. Is there a way to prevent this behavior/this redirect while using this plugin? Are you aware of any interactions between gatsby, gatsby-source-prismic-graphql, gatsby's Link components etc. that would cause this issue? Has anyone else used pathprefix with gatsby-source-prismic-graphql and had things work correctly? I'm aware that prismic is recommending everyone migrate to gatsby-source-prismic instead but this of course involves a refactor of basically the entire codebase. It seems like this is such a basic use case with the pathprefix that I'm unsure why this is even an issue in the first place!

Please let me know your thoughts, thanks!

Quick update--migrated the entire project to gatsby-source-prismic, the same issue is happening.

Hi Zach,

Thank you for contributing to the community forum.

Happy to hear that you've been able to migrate to the "gatsby-source-prismic".

In order to debug this issue I need some more information, can you please share with us a code sneppt of the problematic page, Gatsby link, and link resolver in gatsby-config.js

Here is a small example of how to use links in "gatsby-source-prismic" plugin that might be relevant.

Also, it would be great if you can share with us your repository name (in a private message in neessery).

Looking forward to your reply,

Hey Fares,

I figured this one out last night, it ended up being something from our codebase rather than the plugin itself causing the redirect (typical)!

Thanks for your response, I have another related question though--how long will it be feasible for repositories to continue using the gatsby-source-prismic-graphql plugin if we're not affected by the gatsby cloud concerns?



Awesome, happy to hear that,
We didn't set a time frame yet to stop maintaning the plugin fork, in fact currently we are only giving the most basic support on our fork of the plugin '@prismicio/gatsby-source-prismic-graphql'

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.