S
SolidJS•5d ago
Mobs

Running into ambiguous error

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 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.
createEffect(
on(
() => props.measurements,
() => {
if (!props.measurements) return;
getErrors();
setSelectedAgent(props.optimizationData.agent);
loadLabels();
loadExpressions();
}
)
);
createEffect(
on(
() => props.measurements,
() => {
if (!props.measurements) return;
getErrors();
setSelectedAgent(props.optimizationData.agent);
loadLabels();
loadExpressions();
}
)
);
gets called initially in this effect
No description
3 Replies
Mobs
Mobs•5d ago
Deps
No description
Mobs
Mobs•5d ago
When i change loadLabels back to the old implementation the error is not thrown and things go back to normal
bigmistqke 🌈
bigmistqke 🌈•5d ago
mapArray is used internally in <For/> So my guess is some <For/> is getting an incorrect value