Gatsby previews inconsistent results and lack of HTML Serializer

I am using Gatsby and Prismic and seeing inconsistent results with previews. Rich text fields are also not being run through the HTML Serializer that is configured in gatsby-source-prismic in gatsby-config

Packages are:

"gatsby-source-prismic": "^4.1.0",
"gatsby-plugin-prismic-previews": "^4.1.0",

Use case;

  1. Make an edit to a document in Prismic, save and click preview
  2. Site is opened and redirected to correct page. Toolbar is present and "Fetching preview" screen is shown
  3. Following error is displayed (screenshot attached)
  4. Hard refresh browser, on page reload error disappears and correct preview content is shown
  5. HTML Serializer has failed to run on Rich text fields

Hi James,

Welcome to the community!

We were experiencing some preview issues that are now fixed.

This may have been the cause of your issue. Can you try again and let us know if you're still having problems, if so we can dig deeper together.


Hi Steve,

Im still seeing the same issue, points 1 - 4 from previous post. I have solved the HTML Serializer issue.

Any indication of what the error is related too?



I'm not sure to be honest, I'm going to get some help on this.

Hey @jcockburn,

I'm Angelo, the developer of the Gatsby plugins. That error appears when your Custom Type JSON schemas are out of sync with what is saved in Prismic (assuming there isn't a bug in the plugin).

Do you use the customTypesApiToken plugin option to automatically pull the Custom Type JSON files? Instructions can be found here: Install the Gatsby Source Plugin - Prismic

If not, can you make sure all of the Custom Type JSON file are update in your project? Instructions can be found here: Install the Gatsby Source Plugin - Prismic

Regarding the HTML Serializer issue, this could be a result of the above error (the Custom Type JSON file could be outdated so it doesn't know that your Rich Text field is a Rich Text field).

It also may not have been provided to the preview plugin. You can see all available options here, including where to provide htmlSerializer: gatsby-plugin-prismic-previews Technical Reference - Prismic

I see you resolved the HTML Serializer issue, but I figured I would provide that info just in case.

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