Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

366
Vistas
Error: Type with name "AuthorYaml" does not exists - gatsby-casper starter

I'm trying to build a gatsby website based on gatsby-casper starter but I am getting a hard to debug error related to the graphql schema. The error I get is this:

Error: Type with name "AuthorYaml" does not exists

- TypeStorage.js:44 SchemaComposer.get
[Physicc-blog]/[graphql-compose]/lib/TypeStorage.js:44:13

- TypeMapper.js:585 ThunkComposer._thunk
[Physicc-blog]/[graphql-compose]/lib/TypeMapper.js:585:34

- ThunkComposer.js:20 ThunkComposer.get ofType [as ofType]
[Physicc-blog]/[graphql-compose]/lib/ThunkComposer.js:20:34

- ThunkComposer.js:46 ThunkComposer.getType
[Physicc-blog]/[graphql-compose]/lib/ThunkComposer.js:46:17

- ListComposer.js:22 ListComposer.getType
[Physicc-blog]/[graphql-compose]/lib/ListComposer.js:22:49

- ObjectTypeComposer.js:348 ObjectTypeComposer.getFieldConfig
[Physicc-blog]/[graphql-compose]/lib/ObjectTypeComposer.js:348:18

- index.js:220 forEach
[Physicc-blog]/[gatsby]/src/schema/extensions/index.js:220:48

- Array.forEach

- index.js:215 forEach
[Physicc-blog]/[gatsby]/src/schema/extensions/index.js:215:8

- Array.forEach

- index.js:211 processFieldExtensions
[Physicc-blog]/[gatsby]/src/schema/extensions/index.js:211:32

- schema.js:226 processTypeComposer
[Physicc-blog]/[gatsby]/src/schema/schema.js:226:11

- schema.js:200 map
[Physicc-blog]/[gatsby]/src/schema/schema.js:200:7

- Array.map

- schema.js:199 updateSchemaComposer
[Physicc-blog]/[gatsby]/src/schema/schema.js:199:50

- schema.js:64 buildSchema
[Physicc-blog]/[gatsby]/src/schema/schema.js:64:3

I have used

gatsby new my-gatsby-project https://github.com/scttcper/gatsby-casper

to initialize the project. I'm unable to figure out why this error is being generated.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Well... that starter (gatsby-casper) has a reference to AuthorYaml in the gatsby-node.js at line 105:

  allAuthorYaml {
    edges {
      node {
        id
      }
    }

So if you haven't defined that node, your GraphQL query is not able to run, hence the code is breaking.

Pulling more the thread, allAuthorsYaml is a node created by gatsby-transformer-yaml, present in gatsby-config.js (line 64):

'gatsby-transformer-yaml',

And mapped in line 11 of the same gatsby-config.js file:

  mapping: {
    'MarkdownRemark.frontmatter.author': 'AuthorYaml',
  },

This means that you are creating an AuthorYaml node from the author field in your markdown frontmatter.

So, if your markdown frontmatter doesn't contain an author reference, your code will break. It can be easily fixed by setting the proper author in the markdown file, or just by removing allAuthorYaml query node from the gatsby-node.js and all the related references to them like:

  // Create author pages
  const authorTemplate = path.resolve('./src/templates/author.tsx');
  result.data.allAuthorYaml.edges.forEach(edge => {
    createPage({
      path: `/author/${_.kebabCase(edge.node.id)}/`,
      component: authorTemplate,
      context: {
        author: edge.node.id,
      },
    });
  });
};

From line 188 from gatsby-node.js file.

The same applies for authorTemplate since you won't be passing any author in the context your authorTemplate query will fail too.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda