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

435
Vistas
I'm having an Error in Mounted hook (Promise/Async) in my Vue js App

ive setup my Vuex store and modules with all endpoints declared in my actions and connected to the getters too.

but my app returns this error compilation.

Help me check what might be wrong.

I have this in my methods

...mapActions('codes', [
      'fetchCode',
      'fetchCodes',
      'updateCode',
      'selectCode',
      'setSelectAllState'
  ]),

  async fetchData({page, sort}) {
    let data = {

      name: this.filters.name ? this.filters.name : null,

        from_date:
          this.filters.from_date === ''
            ? this.filters.from_date
            : this.filters.from_date,

        to_date:
          this.filters.to_date === ''
            ? this.filters.to_date
            : this.filters.to_date,

        orderByField: sort.fieldName || 'created_at',

        orderBy: sort.order || 'desc',
        page,
    }

    this.isRequestOngoing = true
    let response = await this.fetchCodes(data)
    this.isRequestOngoing = false

  

  return {
    
    data: response.data.result.data,

  }    
  },

It only returns this error in my browser console

[Vue warn]: Error in mounted hook (Promise/async): "TypeError: Cannot read properties of undefined (reading 'page')"

I've googled the hell out of this error, checked my api numerous times.. :(

Meanwhile the

  let response = await this.fetchCodes(data)

gets its data from this end (actions.js)

import * as types from './mutation-types'
export const fetchCodes = ({commit, dispatch, state}, params) => {
    return new Promise((resolve, reject) => {
        window.axios
        .get(`/api/myendpoint`, {params})
        .then((response)=>{
            commit(types.FETCH_CODES, response.data.result.data)
            resolve(response)
        })
        .catch((err)=>{
            reject(err)
        })
    })
}

I've fixed the mutations to connect with their states too

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