Files
solace-bg-dubai/ERRORS_AND_ISSUES.md

129 lines
4.4 KiB
Markdown
Raw Normal View History

# Errors and Issues Review
## 🔴 Critical Errors
### 1. Frontend TypeScript Error
**File**: `frontend/lib/web3/config.ts`
**Error**: `'wagmi/chains' has no exported member named 'defineChain'`
**Status**: Type checking fails
**Impact**: TypeScript compilation error in frontend
**Fix Required**: Check wagmi v2 imports - this might be incorrect import or API change
### 2. Backend TypeScript Compilation Errors
**File**: `backend/tsconfig.json` and dependencies
**Errors**: Multiple TypeScript errors in `ox` dependency:
- `Property 'replaceAll' does not exist on type 'string'` - needs ES2021+ lib
- Multiple `Cannot find name 'window'` errors in WebAuthn code
- Override modifier issues
**Status**: Backend build fails
**Impact**: Backend cannot compile
**Fix Required**: Update tsconfig.json lib to include ES2021+ and DOM types
## ⚠️ Warnings (Non-Blocking)
### Frontend Linting Warnings
#### Unused Variables/Imports
1. **`frontend/app/activity/page.tsx`**:
- `address` assigned but never used (line 11)
- `any` type used (line 15)
2. **`frontend/app/approvals/page.tsx`**:
- `useReadContract` imported but never used (line 4)
- `address` assigned but never used (line 11)
- `setProposals` assigned but never used (line 15)
- `any` type used (line 15)
3. **`frontend/app/receive/page.tsx`**:
- `formatAddress` imported but never used (line 5)
4. **`frontend/app/send/page.tsx`**:
- `any` type in error handler (line 56)
5. **`frontend/app/settings/page.tsx`**:
- `address` assigned but never used (line 11)
6. **`frontend/app/transfer/page.tsx`**:
- `any` type in error handler (line 59)
7. **`frontend/components/dashboard/BalanceDisplay.tsx`**:
- `Text3D` imported but never used (line 6)
8. **`frontend/components/ui/ParticleBackground.tsx`**:
- `useEffect` imported but never used (line 3)
9. **`frontend/lib/web3/contracts.ts`**:
- `getAddress` imported but never used (line 1)
#### React Hooks Issues
1. **`frontend/components/dashboard/RecentActivity.tsx`**:
- `transactions` array makes useEffect dependencies change on every render
- Should wrap in `useMemo()`
#### Type Safety Issues
- Multiple uses of `any` type instead of proper types
- Should use `Error` type or custom error interfaces
## 📝 TODO Items (Planned Features)
### Backend
- `backend/src/indexer/indexer.ts`:
- TODO: Map proposal to treasury in database (line 136)
- TODO: Add approval to database (line 142)
- TODO: Update proposal status to executed (line 147)
### Frontend
- `frontend/app/transfer/page.tsx`: TODO: Fetch sub-accounts from backend/contract (line 20)
- `frontend/app/approvals/page.tsx`: TODO: Fetch pending proposals from contract/backend (line 14)
- `frontend/app/activity/page.tsx`: TODO: Fetch transactions from backend (line 14)
- `frontend/app/activity/page.tsx`: TODO: Fetch CSV from backend API (line 33)
- `frontend/app/settings/page.tsx`: TODO: Fetch owners and threshold from contract (line 17)
- `frontend/components/dashboard/PendingApprovals.tsx`: TODO: Fetch pending approvals from contract/backend (line 7)
- `frontend/components/dashboard/RecentActivity.tsx`: TODO: Fetch recent transactions from backend/indexer (line 18)
## 🔧 Recommended Fixes
### Priority 1: Critical Errors
1. **Fix Frontend TypeScript Error**:
```typescript
// Check if defineChain exists in wagmi/chains or use different import
// May need to update wagmi version or use different chain configuration
```
2. **Fix Backend TypeScript Config**:
```json
// backend/tsconfig.json
{
"compilerOptions": {
"lib": ["ES2021", "DOM"], // Add ES2021 and DOM
// ... rest of config
}
}
```
### Priority 2: Code Quality
1. **Remove Unused Imports/Variables**
2. **Replace `any` types with proper types**:
- Error handlers: `catch (err: unknown)` or `catch (err: Error)`
- Transaction types: Define proper interfaces
- Proposal types: Use shared types from backend
3. **Fix React Hooks**:
- Wrap `transactions` in `useMemo()` in RecentActivity component
### Priority 3: Implementation TODOs
1. Complete backend indexer implementation
2. Connect frontend to backend APIs
3. Implement data fetching in frontend components
## Summary
- **Critical Errors**: 2 (blocking builds)
- **Warnings**: 14 (non-blocking but should be fixed)
- **TODOs**: 9 (planned features)
- **Overall Status**: Project functional but needs fixes for clean builds