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

351
Vistas
Problem with sitemap generation in Gatsby js

I'm having a problem with creating a sitemap for my website. this is gatsby-config.js content :

module.exports = {
  siteMetadata: {
    siteUrl: `https://www.mywebsite.com`,
  },
  plugins: [
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images/`,
      },
    },
    {
      resolve: 'gatsby-plugin-sitemap',
      options: {
        excludes: [],
        query: `
        {
          site {
            siteMetadata {
              siteUrl
            }
          }
          allSitePage {
           nodes {
             path
           }
          }
      }`,
        serialize : ({site,allSitePage}) =>
             allSitePage.nodes.map(node => { // this is line 32
                return {
                  url: `${site.siteMetadata.siteUrl}${node.path}`,
                  changefreq: `never`,
                  priority: 0.5,
                }
              })
          },
    },
    'gatsby-plugin-react-helmet',
    `gatsby-plugin-image`,
    `gatsby-plugin-sharp`,
  ],
}
I get this error when I want to build the project :

enter image description here

note: when I don't add options like this:

module.exports = {
  siteMetadata: {
    siteUrl: `https://www.mywebsite.com`,
  },
  plugins: [
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images/`,
      },
    },
    'gatsby-plugin-sitemap',
    'gatsby-plugin-react-helmet',
    `gatsby-plugin-image`,
    `gatsby-plugin-sharp`,
  ],
}

everything works fine but it does not meet my needs (all pages have the same priority 0.7)


Solved! this code does not work with versions above 3.3.0 so I downgraded the sitemap plugin from 4.9.0 to 3.3.0 and now works like a charm.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

For those who may be facing the issue: It as been solved by downgrading the plugin to the 3.3.0 version prior to the 4.9.0 (the one causing the issue).

https://www.npmjs.com/package/gatsby-plugin-sitemap/v/3.3.0

about 4 years ago · Juan Pablo Isaza 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