Skip to content

Improve name-based narrowing for createClientResolver errors - #5588

Merged
jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/create-client-resolver-error-narrowing
Nov 18, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/create-client-resolver-error-narrowing

Conversation

@mortezashojaei

@mortezashojaei mortezashojaei commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

createClientResolver.ts exposes ChainNotConfiguredError and TransportNotConfiguredError in createClientResolver.ErrorType. Their constructors set stable namespaced names:

  • createClientResolver.ChainNotConfiguredError
  • createClientResolver.TransportNotConfiguredError

The class types inherit name: string from BaseError, so these names are not represented as literal discriminants in the declared union.

This is a potential public typing improvement, not a runtime failure. Class-based checks with instanceof remain available.

Validation

Source, root exports, and existing resolver error tests inspected at 596dcc3. The tests confirm the current namespaced names and class checks. A failing consumer type test has not yet been run; establishing the practical narrowing benefit is required before proposing a PR.

@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 655c854

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jxom
jxom merged commit bdf9364 into wevm:main Nov 18, 2026
28 of 35 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
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.

2 participants