Hi, I am experiencing a really bizarre error in my click handler. And am not sure on how to debug. I have tried removing the
.vite
.vite
directory and tried rerunning but no luck. Suspiciously this only started when I changed my code slightly
from being:
function loadLabels() { const saved: typeof props.measurements = deepCopy(props.measurements); if (saved) { let labels: any[] = []; for (const analysis of Object.values(saved)) { labels = labels.concat(Object.values(analysis.instructions)); } setLabels(labels); }}
function loadLabels() { const saved: typeof props.measurements = deepCopy(props.measurements); if (saved) { let labels: any[] = []; for (const analysis of Object.values(saved)) { labels = labels.concat(Object.values(analysis.instructions)); } setLabels(labels); }}
to:
function loadLabels() { const saved: typeof props.measurements = deepCopy(props.measurements); if (saved) { let labels: any = {}; for (const analysis of Object.values(saved)) { for (const instruction of analysis.instructions) { labels[instruction.name] = 0; } } setLabels(labels); }}
function loadLabels() { const saved: typeof props.measurements = deepCopy(props.measurements); if (saved) { let labels: any = {}; for (const analysis of Object.values(saved)) { for (const instruction of analysis.instructions) { labels[instruction.name] = 0; } } setLabels(labels); }}
And this function here is in the component that shows up when I click the tab associated to it.