I checked other threads but couldn't find the solution.
setup() {
const processingData = ref(null)
}
Function:
function create() {
let field = JSON.parse(processingData.value.fields)
for (let i = 0; i < field.length; i++) {
console.log(i)
}
}
Error on JSON.parse(processingData.value.fields): Object is possibly 'null'.Vetur(2531) const processingData: Ref<null>
processingData is 100% accessable, as It's being set with another function already.
createfunction, is it defined inside setup() ?processingData.valuein the first line insidecreatefunction and check if that contains attribute called fields?