"Cannot read properties of null (reading 'useContext')" crash triggered from Trader Profile tab with Station wallet connected #126
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#126
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue Summary
After connecting a Station wallet and navigating to the Trader Profile tab, the entire page crashes with a full screen error overlay displaying "SOMETHING WENT WRONG" and the message
Cannot read properties of null (reading 'useContext'). Clicking any other navigation tab (Swap, Pool, Limits, Trade, Charts) while the error is displayed does not recover the page. A manual browser refresh resolves the issue.Reproduction Steps
make deploy-local), run the indexer (make indexer-dev), and start the frontend (VITE_NETWORK=local npm run dev)http://localhost:5173in Chromelocalterra, LCDhttp://localhost:1317, RPChttp://localhost:26657)Expected Behavior
Clicking the Trader Profile tab after wallet connection should render the Trader Profile page without errors. Navigation to other tabs should remain functional at all times.
Actual Behavior
The app crashes with a full-screen error overlay:
All navigation tabs become non-functional until the page is manually refreshed. The "TRY AGAIN" button is shown but a full refresh is required to restore the app.
Environment Details
localterra(local Docker)VITE_NETWORK=local npm run devmake indexer-dev)make deploy-localWallet / Device Details
http://localhost:1317, RPChttp://localhost:26657Screenshots
Console Logs
Console was not captured at the time of occurrence. Will record DevTools console output on next reproduction attempt.
Severity / Impact
Since bug is not reproducible at will, no severity is assigned.
mentioned in issue #133
mentioned in commit
8a8b49ab44Update (fix merged to
main)Implemented hardening for the Trader Profile route after investigation of the
useContext/ full-screen error report (8a8b49a).What changed
GET /api/v1/traders/:addressviaparseIndexerTraderPayloadsonull, arrays, or partial objects never become a truthytraderobject that could throw during render (frontend-dapp/src/services/indexer/traderProfilePayload.ts, wired fromgetTraderinclient.ts).resetKeystied to:addressso moving between/trader,/trader/<addr>, or another address clears a prior route error without a full reload (TraderRouteShellinApp.tsx).resolve.dedupeforreact/react-domto reduce rare dual-React dev/bundle issues that surface as invalid hook /useContexterrors when lazy chunks load.StatBox/TradesTable/RetryError/Skeletonfrom their modules (smaller lazy chunk, less barrel surface).docs/frontend.md§ Trader profile (indexer JSON + route error recovery). Skills crosslinks:skills/AGENTS_BUNDLE_DEV_WALLET.md,skills/AGENTS_LOCALNET_TRADING_SWARM.md.frontend-dapp/src/services/indexer/traderProfilePayload.test.ts(Vitest). Fullnpm run test:unitandnpm run buildwere run successfully on the branch before merge.Checklist for verification (@totdking)
VITE_NETWORK=local npm run dev(per issue repro)./traderand/trader/<you>).Something went wrong/useContextoverlay; indexer-offline paths still show the existing indexer warning / retry UI./trader/<addr>) and confirm the UI recovers without a hard refresh (resetKeys).GET .../api/v1/traders/<addr>returns JSON object withaddress; malformed proxy responses should surface as query error (“Trader not found” / retry), not a white-screen hook crash.Please verify on your side when you have a moment — leaving the issue open until you confirm.
cc @totdking
Checklist for verification (@totdking)
VITE_NETWORK=local npm run dev(per issue repro)./traderand/trader/<you>).Something went wrong/useContextoverlay; indexer-offline paths still show the existing indexer warning / retry UI./trader/<addr>) and confirm the UI recovers without a hard refresh (resetKeys). - COULD NOT TRIGGER THE ROUTE-LEVEL ERRORGET .../api/v1/traders/<addr>returns JSON object withaddress; malformed proxy responses should surface as query error (“Trader not found” / retry), not a white-screen hook crash.Visual checklist verification for crash triggered on "trader's profile" tab
localterra(local Docker)VITE_NETWORK=local npm run devmake indexer-dev)make deploy-local**Ready for close on dev side** : true
cc: @PlasticDigits
Closing, keep an eye out for the route level error if it reemerges please link this issue
mentioned in issue #656
mentioned in issue #657
marked as related to #657
mentioned in issue #665
mentioned in issue #706