Skip to content

fix: repair TypeScript build errors (tsc -b) - #36

Merged
merlik787-droi merged 1 commit into
mainfrom
fix/typescript-build-errors
Oct 9, 2026
Merged

merlik787-droi merged 1 commit into
mainfrom
fix/typescript-build-errors

Conversation

@merlik787-droi

Copy link
Copy Markdown
Contributor

Closes #35

Problem

tsc -b (i.e. npm run build) fails on main; CI never caught it because the workflow only runs npm ci && npm test.

Fixes

  1. src/session/storageKeys.ts — add the missing WALLET_STATE and THEME_PREFERENCE keys. walletCache.ts, storeSlice.ts and themeStore.ts already reference them. Besides unblocking tsc, this fixes a real bug: useThemeStore's zustand persist({ name: STORAGE_KEYS.THEME_PREFERENCE }) was passing undefined, so theme preference was never persisted.
  2. src/pages/Dashboard.tsx — remove two duplicate useLeaderboard imports (it was imported three times).
  3. src/session/clearSession.ts — actually dispatch resetStore() on sign-out. It was imported but unused, which meant the previous user's wallet stayed in memory after signing out (and tripped the unused-import lint). clearSession also covers the new keys via Object.values(STORAGE_KEYS).

Verification

npm run build   → vite build succeeds (tsc -b clean)
npm test        → 19 files, 84 tests passed
npm run lint    → 1 pre-existing error remains (setState-in-effect), fixed in a follow-up

- storageKeys: add the missing WALLET_STATE and THEME_PREFERENCE keys
  referenced by walletCache, storeSlice and themeStore; without them
  tsc failed and the theme store's zustand `persist` name was undefined
- Dashboard: drop two duplicate `useLeaderboard` imports
- clearSession: dispatch resetStore() so sign-out clears the in-memory
  wallet instead of leaking the previous user's balance into the next
  session (also resolves the unused-import lint)
@merlik787-droi
merlik787-droi merged commit 808f0df into main Oct 9, 2026
@merlik787-droi
merlik787-droi deleted the fix/typescript-build-errors branch October 9, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend does not type-check: npm run build (tsc -b) fails on main

2 participants