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

431
Views
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
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!