Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

345
Views
Mapa del sitio de Gatsby: GraphQLError: error de sintaxis: nombre esperado, encontrado <EOF>

He estado tratando de hacer que el complemento del mapa del sitio de Gatsby funcione durante un tiempo y no puedo entender qué estoy haciendo mal aquí. Primero, no pude extraer site.siteMetadata.siteTitle , así que tuve que configurarlo con una función. Ahora, tengo problemas para agregar páginas al mapa del sitio. Sí, probé la consulta en Graphiql varias veces y funciona.

Recibo el siguiente error y debajo está la configuración de mi mapa del sitio (solo intento que las páginas funcionen por ahora):

 "gatsby-plugin-sitemap" threw an error while running the onPostBuild lifecycle: Syntax Error: Expected Name, found <EOF>. 40 | output = _ref2.output, entryLimit = _ref2.entryLimit, query = _ref2.query, excludes = _ref2.excludes, resolveSiteUrl = _ref2.resolveSiteUrl, resolvePagePath = _ref2.resolvePagePath, resolvePages = _ref2.resolvePages, filterPages = _ref2.filterPages, serialize = _ref2.serialize; 41 | _context.next = 4; > 42 | return graphql(query); | ^ 43 | 44 | case 4: 45 | _yield$graphql = _context.sent; File: node_modules/gatsby-plugin-sitemap/gatsby-node.js:42:20
 { resolve: `gatsby-plugin-sitemap`, options: { query: `{ site { siteMetadata { siteUrl } } allSitePage { nodes { path } } allMarkdownRemark { edges { node { frontmatter { slug } } } }`, resolveSiteUrl: siteUrl, resolvePages: ({ allSitePage: {nodes: allPages} }) => { return allPages.map(page => { return { ...page } }) }, serialize: ({ path }) => { return { url: path, priority: 0.7, }; }, }, },

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Creo que te falta un } al final de tu consulta:

 { resolve: `gatsby-plugin-sitemap`, options: { query: `{ site { siteMetadata { siteUrl } } allSitePage { nodes { path } } allMarkdownRemark { edges { node { frontmatter { slug } } } } }`, resolveSiteUrl: siteUrl, resolvePages: ({ allSitePage: {nodes: allPages} }) => { return allPages.map(page => { return { ...page } }) }, serialize: ({ path }) => { return { url: path, priority: 0.7, }; }, }, },

Debido a que el objeto de consulta no tiene el formato correcto, arroja la excepción de sintaxis ( <EOF> , fin de archivo).

El resto debería trabajar solo.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!