Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v5] Prismic preview is not working #534

Open
aniruddhashevle opened this issue Jun 16, 2023 · 10 comments
Open

[v5] Prismic preview is not working #534

aniruddhashevle opened this issue Jun 16, 2023 · 10 comments
Labels
bug V5 Related to v5

Comments

@aniruddhashevle
Copy link

aniruddhashevle commented Jun 16, 2023

Versions

  • gatsby-source-prismic: "^5.3.1"
  • gatsby-plugin-prismic-previews: "^5.3.1"
  • node: v18.12.0

Reproduction

I've followed official documentation:

  1. https://prismic.io/docs/previews-gatsby
  2. https://prismic.io/docs/technical-reference/gatsby-plugin-prismic-previews
  3. https://community.prismic.io/t/troubleshooting-previews/5449
  4. I've even tried all the solutions mentioned in prev github issue v4: [v4] A configuration object could not be found #384

Steps to reproduce

I've followed official documentation:

  1. https://prismic.io/docs/previews-gatsby
  2. https://prismic.io/docs/technical-reference/gatsby-plugin-prismic-previews

What is expected?

Should preview drafts documents.

What is actually happening?

Gives error configuration object could not be found. Check that the repository is configured in your app's withPrismicPreview and withPrismicUnpublishedPreview. Which is exactly shown in the image of this issue comment: #384 (comment) but with diff repo name and version of course.
image

My linkResolver is also working fine.

I believe its a problem with withPrismicPreview and I've provided repositoryName string and linkResolver properly.
And my Preview component doesn't redirect to the route for my respective template/page that I've mentioned in linkResolver and PrismicPreviewProvider's componentResolver.

@aniruddhashevle aniruddhashevle changed the title Prismic preview is not working for v5 [v5] Prismic preview is not working Jun 16, 2023
@aniruddhashevle
Copy link
Author

Any updates on this?

@angeloashmore
Copy link
Member

Hi @aniruddhashevle, gatsby-source-prismic and gatsby-plugin-prismic-previews v6 were just released. Could you try updating and let me know if the problem still happens?

See the documentation for guides on updating to the latest versions: Gatsby + Prismic Migration Guides

@angeloashmore angeloashmore added the V5 Related to v5 label Jun 29, 2023
@taoufiqlotfi-veedoo
Copy link

any updates on this i am facing the same issues ?

@aniruddhashevle
Copy link
Author

aniruddhashevle commented Aug 18, 2023

@angeloashmore : We're still having problems with v6. We can't preview the latest draft contents from Prismic.

We've followed v5 to v6: https://github.com/prismicio/prismic-gatsby/blob/main/docs/migration-guide-v5-to-v6.md
Also, we've upgraded gatsby v4 to v5: https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v4-to-v5/
And node min v18.0.0 as per recommendations.

We don't see the above red box error, however, we observe the below error, even after specifying a valid config for both gatsby-plugin-prismic-previews and gatsby-source-prismic and both the configs are same.

image

@AlyssaKirstine
Copy link

@aniruddhashevle Did you ever find a fix for this? I'm running into the same issue.

@aniruddhashevle
Copy link
Author

@AlyssaKirstine : Nope and the Prismic team also not replying on this to fix/guide. We've even ask'em questions on their atlassian portal and the issue couldn't resolve there as well.

They also informed us that,

It's important to note that our Gatsby docs are currently open source, and we're transitioning away from supporting them. For more information, please refer to the official announcement from our DevX team.

Please check the above link specifically section Our future plans for Gatsby + Prismic.

@AlyssaKirstine
Copy link

@aniruddhashevle I appreciate the update. This is disappointing news 😔 Did you try any alternatives to the gatsby-plugin-prismic-previews plugin? I think I'm going to look into if I can use the still supported prismicio/react package instead.

@aniruddhashevle
Copy link
Author

@AlyssaKirstine : Indeed disappointing news it is. And, an alternative for this, nope, we've spent so much time already on this and we didn't wanna invest more time for this. So not pretty sure about the alternatives.

@AlyssaKirstine
Copy link

@aniruddhashevle Not sure if this will be helpful, but I found a solution for my situation. I was using @babel/plugin-transform-modules-commonjs in my Babel config and removing that fixed things for me.

@aniruddhashevle
Copy link
Author

@AlyssaKirstine : Great to know that you found a work around for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V5 Related to v5
Projects
None yet
Development

No branches or pull requests

4 participants