I've search here for topics about gatsby-plugin-prismic-previews not working but it's not the same issue I got recently.
I followed all instruction the gatsby-plugin-prismic-previews v5.3.1. When I clicked the "View" icon, all i get is the /preview page in Gatsby like "Loading preview.."
The preview.jsx code is this:
import * as React from "react";
import { withPrismicPreviewResolver } from "gatsby-plugin-prismic-previews";
const PreviewPage = () => {
return (
<div>
<h1>Loading preview…</h1>
</div>
);
};
export default withPrismicPreviewResolver(PreviewPage);
Is there something wrong?
I'm using this for a client project using Prismic for CMS.
Aside from the 404 page update, all I did to was to update my previews.js file with componentResolverFromMap like here:
import { componentResolverFromMap } from "gatsby-plugin-prismic-previews";
import { linkResolver } from "./link-resolver";
import PostTemplate from "../../src/pages/blog/{prismicBlogPost.uid}";
/**
* Prismic preview configuration for each repository in your app. This set of
* configuration objects will be used with the `PrismicPreviewProvider`
* higher order component.
*
* If your app needs to support multiple Prismic repositories, add each of
* their own configuration objects here as additional elements.
*
*/
export const repositoryConfigs = [
{
repositoryName: process.env.GATSBY_PRISMIC_REPO_NAME,
linkResolver,
componentResolver: componentResolverFromMap({
blog_post: PostTemplate,
}),
},
];
Thank you so much for all the help! You're the best!