Summary
frontend/src/pages/visualize/forecast.tsx declares trainFamily twice — once via useState at L68 (PRP-37 Slice C train-card form state) and once via const at L120 (PRP-31 derived value from a loaded predict job's training metadata). Babel/Vite reject this as Cannot redeclare block-scoped variable 'trainFamily'; TypeScript also reports TS2451 at both sites.
Effect: the Forecast page (/visualize/forecast) cannot compile in the browser. Vite returns 500 on GET /src/pages/visualize/forecast.tsx, the React tree never mounts.
Discovered while running the PRP-37 Task 26 dogfood against the merged dev (5e86b6f).
Repro
cd frontend && ./node_modules/.bin/vite --host 0.0.0.0
- Browse
http://localhost:5173/visualize/forecast
- React error boundary fires; console shows
Identifier 'trainFamily' has already been declared. (120:8)
./node_modules/.bin/tsc --noEmit -p ./tsconfig.app.json reports:
src/pages/visualize/forecast.tsx(68,10): error TS2451: Cannot redeclare block-scoped variable 'trainFamily'.
src/pages/visualize/forecast.tsx(120,9): error TS2451: Cannot redeclare block-scoped variable 'trainFamily'.
Fix
Rename the L120 derived value to loadedTrainFamily (distinct from the train-form state, which keeps the trainFamily name). Update its single consumer at L497–498 (the ModelFamilyBadge in the "Model details" collapsible).
The two values are semantically distinct:
trainFamily (L68) is the user-selected family for the Train-a-new-model card (PRP-37 Slice C).
loadedTrainFamily (L120) is the family derived from a loaded predict job's training metadata (PRP-31, shown as a badge in the "Model details" panel).
Why this slipped through
PRP-37's per-task validation gates reported pnpm tsc --noEmit clean, but the merged file fails both Babel parse and tsc. Possibly run against a different staged tree or the duplicate was introduced in a late edit.
Summary
frontend/src/pages/visualize/forecast.tsxdeclarestrainFamilytwice — once viauseStateat L68 (PRP-37 Slice C train-card form state) and once viaconstat L120 (PRP-31 derived value from a loaded predict job's training metadata). Babel/Vite reject this asCannot redeclare block-scoped variable 'trainFamily'; TypeScript also reportsTS2451at both sites.Effect: the Forecast page (
/visualize/forecast) cannot compile in the browser. Vite returns 500 onGET /src/pages/visualize/forecast.tsx, the React tree never mounts.Discovered while running the PRP-37 Task 26 dogfood against the merged
dev(5e86b6f).Repro
cd frontend && ./node_modules/.bin/vite --host 0.0.0.0http://localhost:5173/visualize/forecastIdentifier 'trainFamily' has already been declared. (120:8)./node_modules/.bin/tsc --noEmit -p ./tsconfig.app.jsonreports:src/pages/visualize/forecast.tsx(68,10): error TS2451: Cannot redeclare block-scoped variable 'trainFamily'.src/pages/visualize/forecast.tsx(120,9): error TS2451: Cannot redeclare block-scoped variable 'trainFamily'.Fix
Rename the L120 derived value to
loadedTrainFamily(distinct from the train-form state, which keeps thetrainFamilyname). Update its single consumer at L497–498 (theModelFamilyBadgein the "Model details" collapsible).The two values are semantically distinct:
trainFamily(L68) is the user-selected family for the Train-a-new-model card (PRP-37 Slice C).loadedTrainFamily(L120) is the family derived from a loaded predict job's training metadata (PRP-31, shown as a badge in the "Model details" panel).Why this slipped through
PRP-37's per-task validation gates reported
pnpm tsc --noEmit clean, but the merged file fails both Babel parse andtsc. Possibly run against a different staged tree or the duplicate was introduced in a late edit.