Summary
src/main.ts's bootstrap() function declares const port = configService.get<number>('app.port'); twice — once near the top (used immediately for the isNaN(port) validation check) and again, identically, right before await app.listen(port) near the end of the same function. This is a duplicate block-scoped variable declaration in the same scope, which TypeScript rejects outright (Cannot redeclare block-scoped variable 'port').
Why This Matters
main.ts is the application's actual entry point — a compile error here means nest build/npm run start cannot produce a runnable application at all, independent of every other syntax error found elsewhere in the codebase. This is a small, easy fix, but it is a genuine, currently-committed blocker to booting the app even after every other file-level syntax error is resolved.
What Needs to Be Done
- Remove the second
const port = ... declaration near the end of bootstrap() and reuse the port variable already declared and validated earlier in the function for the app.listen(port) call.
- Re-run
npx tsc --noEmit against main.ts to confirm no redeclaration error remains.
- Add the file to whatever CI build/typecheck step is introduced to catch this class of error going forward.
Key Files
src/main.ts (both const port = configService.get<number>('app.port'); declarations)
Acceptance Criteria
Points: 200
Category: FIX
Summary
src/main.ts'sbootstrap()function declaresconst port = configService.get<number>('app.port');twice — once near the top (used immediately for theisNaN(port)validation check) and again, identically, right beforeawait app.listen(port)near the end of the same function. This is a duplicate block-scoped variable declaration in the same scope, which TypeScript rejects outright (Cannot redeclare block-scoped variable 'port').Why This Matters
main.tsis the application's actual entry point — a compile error here meansnest build/npm run startcannot produce a runnable application at all, independent of every other syntax error found elsewhere in the codebase. This is a small, easy fix, but it is a genuine, currently-committed blocker to booting the app even after every other file-level syntax error is resolved.What Needs to Be Done
const port = ...declaration near the end ofbootstrap()and reuse theportvariable already declared and validated earlier in the function for theapp.listen(port)call.npx tsc --noEmitagainstmain.tsto confirm no redeclaration error remains.Key Files
src/main.ts(bothconst port = configService.get<number>('app.port');declarations)Acceptance Criteria
portis declared exactly once inbootstrap()npx tsc --noEmitreports no redeclaration error formain.tsNaN/falsy) and listens on the correct port after the fixPoints: 200
Category: FIX