-
Notifications
You must be signed in to change notification settings - Fork 31
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
TypeError on Creating HypercertClient: MeshCache is not a constructor #1189
Comments
|
Are you using NextJS? Could you try addings this line to the next.config?
Here's a reference: https://github.com/hypercerts-org/hypercerts/blob/main/frontend/next.config.mjs If that doesn't help, can you share a reproducable example or the repo you're using? |
I am directly executing the script using Node by running
|
Ok, so you're running it directly. The error bubbles up from the graphClient dependency we use, and we never ran this client as a server component since the focus has been support developing apps. I'll try and get a fix for this over the weekend, apologies for the inconvenience. |
Thanks a lot for the quick response and for looking into this! Really appreciate the effort to get a fix by the weekend. If there's anything I can do to help, just let me know. Cheers! |
I've been able to reproduce locally, now to find the fix... |
Alrigth @yangnoahlin it led to a small rabbithole but the bug has been squashed. Can you try running with SDK version FYI, the issue turned out to be an async call in the Graph client constructor that wasn't marked as async, which doesn't break for ESM modules because they are inherently async, but in CJS it breaks the initialisation of the Indexer Class. For reference you can find a couple of barebone implementations using the latest SDK here: https://github.com/hypercerts-org/demo-apps Can you let me know if if work on your machine as well? If not, please share any errors/log/whatever. |
👏 Huge thanks to bitbeckers! Successfully minted my Hypercerts with 1.0.0-alpha.13. 🚀 |
Which area(s) of Hypercerts are affected? (leave empty if unsure)
SDK
To Reproduce
Describe the Bug
I encounter a TypeError when attempting to create a HypercertClient instance. The error message is "TypeError: MeshCache is not a constructor". This error occurs when I run my application using the @hypercerts-org/sdk package.
Expected Behavior
I expect the HypercertClient to be successfully instantiated with the provided configuration parameters, without throwing a type error. Normally, this should initialize the client and prepare it for interactions with the Hypercerts services.
The text was updated successfully, but these errors were encountered: