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

127
Views
¿Por qué usar ref () en Vue3 causa "RangeError: se excedió el tamaño máximo de la pila de llamadas"?

Soy un poco nuevo en Vue3 y encontré ese problema en un proyecto. A continuación se muestran mis bloques de pseudocódigo:

declaración de variable anidada:

 const testData = ref([ { type: '', title: '', data: { labels: [] as string[], datasets: [ { type: '', label: '', data: [] as number[], }, ], }, }, ])

y aquí es donde arroja el error

 GetData().then(response=>{ if(response != undefined){ response.result.forEach(value=>{ testData.value[0].data.datasets[0].data.push(value)//this line throws out the error }) } ... }).catch(err=>console.log(err))

y el mensaje de error se encuentra a continuación:

 RangeError: Maximum call stack size exceeded at Array.value (helpers.segment.js:1550:26) at Array.instrumentations.<computed> (reactivity.esm-bundler.js:398:42) at Array.value (helpers.segment.js:1550:26) at Array.instrumentations.<computed> (reactivity.esm-bundler.js:398:42) at Array.value (helpers.segment.js:1550:26) at Array.instrumentations.<computed> (reactivity.esm-bundler.js:398:42) at Array.value (helpers.segment.js:1550:26) at Array.instrumentations.<computed> (reactivity.esm-bundler.js:398:42) at Array.value (helpers.segment.js:1550:26) at Array.instrumentations.<computed> (reactivity.esm-bundler.js:398:42)

De acuerdo con otros artículos en línea, todos dijeron que este error ocurre debido al bucle, pero aquí el bucle foreach solo tiene que repetirse menos de 15 veces, y una vez que cambié testData a una matriz simple sin usar ref (), todo funcionó bien y el resultado final se presentó como lo que esperaba. ¿Puede alguien decirme la razón?

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!