Skip to content

[Bug] main branch fails to typecheck — 3 unrelated pre-existing errors beyond the group-members.tsx issue fixed in PR #74 #75

Description

@grantfox-oss

Getting Started

  1. Fork the repository: https://github.com/JointSave-org/Joint_Save
  2. Clone your fork:
   git clone https://github.com/<your-username>/Joint_Save.git
   cd Joint_Save
  1. Create a new branch:
   git checkout -b fix/main-typecheck-errors

Overview

main currently fails tsc --noEmit with three TypeScript errors, unrelated to each other and unrelated to any specific in-progress feature. This means contributors running a typecheck locally see pre-existing noise that isn't caused by their own changes, and it blocks frontend CI (#54) from passing cleanly.

A fourth, related error in group-members.tsx was already fixed in PR #74 (a JSX nesting bug from a merge conflict) — this issue covers the three that remain.

Current Errors

components/group/group-details.tsx(39,31): error TS2304: Cannot find name 'useOptimisticTransactions'.

components/group/yield-dashboard.tsx(15,18): error TS2459: Module '"@/hooks/useJointSaveContracts"' declares 'STELLAR_RPC_URL' locally, but it is not exported.

components/group/yield-dashboard.tsx(48,18): error TS2503: Cannot find namespace 'rpc'.

hooks/useJointSaveContracts.ts(662,28): error TS2339: Property 'xdr' does not exist on type 'LedgerEntryResult'.

Error 1 — Missing import in group-details.tsx

File: frontend/components/group/group-details.tsx, line 39
Issue: useOptimisticTransactions is called but never imported.
Fix: Add the missing import, e.g.:

import { useOptimisticTransactions } from "@/hooks/useOptimisticTransactions"

Confirm the correct export name and path against the actual hook file before fixing.

Error 2 — STELLAR_RPC_URL not exported

File: frontend/components/group/yield-dashboard.tsx, line 15
Issue: This file imports STELLAR_RPC_URL from @/hooks/useJointSaveContracts, but that file only declares it as a local (non-exported) constant.
Fix: Either export STELLAR_RPC_URL from useJointSaveContracts.ts, or have yield-dashboard.tsx read it directly from process.env.NEXT_PUBLIC_STELLAR_RPC_URL instead of importing it.

Error 3 — Missing rpc namespace import

File: frontend/components/group/yield-dashboard.tsx, line 48
Issue: rpc namespace is referenced but not imported.
Fix: Add the Stellar SDK import, e.g.:

import { rpc } from "@stellar/stellar-sdk"

Error 4 — LedgerEntryResult type mismatch

File: frontend/hooks/useJointSaveContracts.ts, line 662
Issue: Code accesses entry.xdr, but the installed @stellar/stellar-sdk version's LedgerEntryResult type doesn't expose that property under that name.
Fix: Check the actual SDK version in package.json against its type definitions, and use the correct field/method (e.g. entry.toXDR() or equivalent) for that version.

Acceptance Criteria

  • tsc --noEmit exits with zero errors on main
  • No @ts-ignore or @ts-expect-error suppressions used — each fix resolves the actual missing import/export/type mismatch
  • group-details.tsx's optimistic transaction flow manually verified to still work correctly after the fix (this error suggests the feature may currently be broken at runtime, not just failing the type check)
  • yield-dashboard.tsx manually verified to load and display data correctly after the fix
  • PR description references this issue so it closes automatically on merge

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSOfficial CampaignCampaign: Official CampaignbugSomething isn't workingpriority: highMajor impact, breaks key feature. fix next after P0

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions