Gatsby build fails on page generation

Hello!

My build fails with error: GraphQLError: Unknown type "PRISMIC_SortBlog_posty"

Config:

...
{
  resolve: '@prismicio/gatsby-source-prismic-graphql',
  options: {
    repositoryName: process.env.PRISMIC_REPOSITORY_NAME,
    accessToken: process.env.PRISMIC_ACCESS_TOKEN,
    path: '/preview',
    previews: true,
    pages: [{
      type: 'Blog_post',
      match: '/about/blog/:uid',
      path: '/blog-preview',
      component: require.resolve('./src/components/blog-post.tsx')
    }]
  }
}
...

I’ve noticed that my graphql-types.ts file changed:

export type Prismic_SortBlog_Posty = => export type Prismic_SortBlog_Post =

It looks removing trailing y fixes the issue https://github.com/prismicio/gatsby-source-prismic-graphql/blob/master/packages/gatsby-source-prismic-graphql/src/gatsby-node.ts#L254

Is there any solution for that?

Hi Andrey,

Welcome to the Prismic community, I will try to help with this.
At a first glance, it seems like it is a typo, I will investigate this and get back to you ASAP.

Fares

I’ve been investigating this, it doesn’t seem to be a typo, and I think that the issue can be due to a missing page type “Blog_post” in your custom types or you don’t have instances of this type.

To be able to figure this out, I need the name of your repository, you can send it to me in a private message if confidential.

Looking forward to your reply.