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

189
Vistas
issue when making request to contentful api using NUXT

I have been able to make requests to a contentful API where I have blogs in them. It suddenly stopped working today but I cannot figure out what I changed, or what the issue is. the message I get Cannot read properties of undefined (reading 'file') doesn't make sense because there is an image there.

Beow is the method that gets blogs

        async getAllBlogs(limit = this.limit, skip = 0) {
            var response = await this.$contentful.client.getEntries({
                content_type: 'blog',
                order: 'fields.id',
                limit,
                skip
            })
            let blogs = response.items;

            blogs = blogs.map((item) => {
                const { id, createdAt } = item.sys;
                const { slug, title, description } = item.fields;
                const thumbnail = item.fields.thumbnail.fields.file.url
                return{
                    id, slug, title, thumbnail, description, createdAt
                }
            })
            console.log(blogs);
            return this.blogs = blogs;
        },

But with this i get in my console

index.vue?6ced:58 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'file')
    at eval (index.vue?6ced:58:1)
    at Array.map (<anonymous>)
    at _callee$ (index.vue?6ced:55:1)
    at tryCatch (runtime.js?96cf:63:1)
    at Generator.invoke [as _invoke] (runtime.js?96cf:294:1)
    at Generator.eval [as next] (runtime.js?96cf:119:1)
    at asyncGeneratorStep (asyncToGenerator.js?1da1:3:1)
    at _next (asyncToGenerator.js?1da1:25:1)

Please, what could be the problem?

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