I am getting below error when i try to pass data to apex. I did everything to debug but unable to find root cause.
aura_prod.js:3 Uncaught (in promise) TypeError: Cannot read property 'Symbol(ViewModel)' of undefined
at vt (aura_prod.js:3)
at Object.Ke [as update] (aura_prod.js:3)
at aura_prod.js:3
at Object.update (aura_prod.js:3)
at En (aura_prod.js:3)
at kn (aura_prod.js:3)
at aura_prod.js:3
at yr (aura_prod.js:3)
at $n (aura_prod.js:3)
at Object.update (aura_prod.js:3)
Below is the apex call from JS
updatedata({
Update: JSON.stringify(records),
currenyRecord: JSON.stringify(currentRecords)
})
.then(result => {
this.isOpenModal = true;
this.isPriceSection=true;
this.priceChange = JSON.stringify(result);
this.isLoaded = true;
})
.catch((error) => {
const evt = new ShowToastEvent({
title: 'Oops! Something went wrong',
message: error,
variant: 'error'
});
this.dispatchEvent(evt);
this.isLoaded = false;
});
EDIT 1
Markup example
<template if:true={isOpenModal}>
<div>
<template if:true={isPriceSection}>
<c-page-section change={priceChange} </c-page-section>
</template>
</div>
</template>
Apex Method simply returns string
also, I am able to pass data correctly to apex and getting expected response too.
BUT, Real issue is, when i hit on save button 'updatedata' will get called, before calling the method i get this error 'Uncaught {in promise}' later my execution goes to .Then(). Can someone please help me understand why i get Uncaught initially and later .Then() gets executed.
I am unable to share the apex method as it is bit complex but only thing i am sure is apex is returning data as expected.