Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: readContract returns never type #2125

Closed
1 task done
holic opened this issue Apr 12, 2024 · 5 comments
Closed
1 task done

bug: readContract returns never type #2125

holic opened this issue Apr 12, 2024 · 5 comments

Comments

@holic
Copy link
Contributor

holic commented Apr 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

4.9.16

Current Behavior

Using readContract on a contract ABI with the correct functionName and args returns a never type (in viem 2.9.16) where it used to return a properly typed object (in viem 2.7.12).

image image image

Expected Behavior

No response

Steps To Reproduce

See repro below (although stackblitz shows the return value as any rather than never and doesn't seem to be resolving types for readContract import)

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

https://stackblitz.com/edit/viem-getting-started-sagfg8?file=index.ts,package.json

Anything else?

No response

@ezynda3

This comment was marked as off-topic.

@jxom
Copy link
Member

jxom commented Apr 15, 2024

Seems to work for me: https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgYygUwIYzQBQK4BGANsMgMIloB2MANHABYwxhwC+cAZlBCHAOQA3YGhD8A3AChQkWIjggMwKlTTwO3XgOGiA9MgZKqAZwnTw0eEnQYAJmQg0oGZOq48+QkSF0uYwR1MpSTQAD1l4ZED4DAJgOABeOABtSThENPS4GABPMDQALgFOPCpXAKp+Wkz0qgwQQoFbNCI1NAAlNCioWyqauGUwPBhjItSsrIR+ibqGov4YWNaASV7qiYnc-PmCHOxjAGYAJj6NrOVsKDqiABU8xv5O4wg8KGQ0VdONtnWNqbPavUHgBrNA5G54MCtL5nLYPXb7Y7JAC6MI2FzQVwwt3uOz2aEORxRaPSP36yN+6ReLGGoxSFP6xkW2AAssNYsASLl5lRHGAMDklmgvmT0v8snD5iUyv5HGjZg8AOZqAAiOVmpAAYiIiGt+oNaWNphkAXAFfNFsQPnrTZKBAiCccSec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ljVymbnxmcwfKc9sqc7NEYiaMcckEp4Ozrd1cZxI2PfG2Mvx4ceL4ZgBOaGqgJ8r8rkY1PCsjvOZYasfbVvj+r2IioQbuf3MEd5tCf0dWcMcxohJJukWkbbWadSe8aBt4Y+eceyaefcfya8fSbrv8ehYrJfuwYvr+fCYBdsBPSZz-R6UUBaPifaP7qefBbseRbHrAIUcipGbyYKchcpqyZpcybRcCauvPuWdvP+ZqaMfxeZ3-VJc1yoaaZsYhepb8dUd8Z6fHARaZalcgdpdheXoxdjt+aqb5Z3sFcJeyRFpBYaZ2bkIlapaKcUeGeB0ZaRfNdOZKc0iCZbKxa1fCfBytHGyIBsDolRVCFB0ofJdcdHO6vLIyclSGfpdzWFQmbF2mZ1xjbmbjZxQWeCYqc1ZWddaFAts1AAcs0SbcyDbzJ6rZbDYXKUc6utGjaTZMXmYTcmcweRDgAwGMBQGiGCEkA2yZBQEoBoESBQBsGwHwGIFIAoBEBoAAApxQDAjAihFBlBVA6BMgPSTAIgigmAWAx2ABKaoNgDd4IDt+AYgCAZAYEXnAuggTEXtjAfcJQSIbtmAAAOmvAuyTOPdPZAHPagE3b3eiGyGUV7f4H2KrEbebf3akH3bgG4N7eSAA6rAbabZbZMBgG-cQ7gBmzwCIHgCSCvZvdQ8wHsEcA9NcDHeQDvfoHFCdOW3mEA6+A5F+GNkcFMc5QfIVsyDssVE8mFXoG4IZB3eCGScsDgGaAbPQ-gAAANn2j3gQzQz3MQigAASBAQ919mTqANgUTqQIAA

Can you fork the playground, break it, then open a new issue? Try double check your TSConfig!

@jxom jxom closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
@wevm wevm unlocked this conversation Aug 27, 2024
@tmm
Copy link
Member

tmm commented Aug 27, 2024

Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants