Skip to content

fix(cli): clear error when quote tokenIn/tokenOut cannot be resolved - #973

Open
ninglinLiu wants to merge 1 commit into
Uniswap:mainfrom
ninglinLiu:fix/cli-missing-token-error-841
Open

ninglinLiu wants to merge 1 commit into
Uniswap:mainfrom
ninglinLiu:fix/cli-missing-token-error-841

Conversation

@ninglinLiu

Copy link
Copy Markdown

Summary

Fixes #841.

The quote CLI resolved tokenIn / tokenOut with getTokenByAddress(...)!. When the provider returned undefined (for example an address not on a token list and not successfully fetched on-chain), later route formatting crashed with:

TypeError: Cannot read properties of undefined (reading 'symbol')

This replaces the non-null assertions with explicit checks that name the missing address and chain id.

Test plan

  • Code review of cli/commands/quote.ts resolution path
  • Manual: ./bin/cli quote with a known-good Base pair still works
  • Manual: quote with an unresolvable tokenOut prints the new error instead of a TypeError on .symbol

Assistance: AI-assisted implementation; I verified the crash site against the issue's Clanker-on-Base reproduction.

The quote CLI used non-null assertions on getTokenByAddress. When the
token provider returned undefined (unknown or unlistable token), later
route logging crashed with TypeError: Cannot read properties of
undefined (reading 'symbol') instead of naming the bad address.

Fixes Uniswap#841
@ninglinLiu
ninglinLiu requested a review from a team as a code owner October 29, 2026 07:23

This branch has not been deployed

No deployments
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.

TypeError: Cannot read properties of undefined (reading 'symbol')

1 participant