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

156
Views
Why data object is reinitialized while CSR in Nuxt.js?
async created() {
    if (process.server) {
      try {
        const data = // API call to fetch FAQs 
        this.faqs = data.faqs
        console.log(this.faqs, ' server')
      } catch (e) {}
    } else {
      console.log(this.faqs, 'client')
    }
  },

Consider the above code with Nuxt.js and SSR enabled. I know it is intended behaviour of Vue to call created hook in both SSR and CSR. But as we can see in the above code, the faqs in data object are mutated in server side and stores the result from API. But when hydration takes place in client side this faqs is set to its initial value which is NULL.

Can some explain this behaviour. Thanks in advance !

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!