-
Notifications
You must be signed in to change notification settings - Fork 240
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: Cannot find module @coinbase/onchainkit/identity or its corresponding type declarations. #1834
Comments
Hi @0x9090 - thanks for flagging!
For reference: TSConfig Reference |
This comment has been minimized.
This comment has been minimized.
For clarification, I don't directly use Node in the back-end project (the back-end is Golang + Gin-Gonic). But I have v20.8.0 installed on my system. When I switch to NodeNext for module and moduleResolution, I get tons of dependency errors and it seems to break more than it fixes. I need to support ecmascript, as this Typescript code runs purely in a browser. |
I finally got it working! After much experimentation and frustration, I did get pure, in-browser Tyepscript working with onchainkit. This was the final tsconfig.json file that worked for me
and my webpack.cjs file
Can I request that some documentation on setting up pure browser-based Typescript and Webpack to be added to the onchainkit documentation? Something that isn't React and Node.js specific. (Because not everyone uses those) Having some kind of documentation here would have saved me many hours of experimentation getting onchainkit types to resolve correctly. |
Describe the bug and the steps to reproduce it
I'm trying to do a ENS name lookup using OnChainKit in Typescript via a browser and without React (I don't use React in my app)
When I try to follow the documentation for getName() https://onchainkit.xyz/identity/get-name I get the error
TS2307: Cannot find module '@coinbase/onchainkit/identity' or its corresponding type declarations.
I am using TypeScript and importing the latest version (0.36.6) of @onchainkit via NPM in package.json. This is my tsconfig.json
I can import @coinbase/onchainkit fine, but it seems like the /identity exports aren't there. Is there some other path I should be importing to get the getName() function working in my app? This is a minimal version of the code I'm trying to get to work
Thanks!
What's the expected behavior?
getName should be an exportable function with the necessary types when importing
@coinbase/onchainkit/identity
in a pure Typescript environmentAlternatively, a working Wagmi or Viem example for their version of getName() would suffice. Those also fail when trying L2 Base ENS resolution
What version of the libraries are you using?
The text was updated successfully, but these errors were encountered: