-
Notifications
You must be signed in to change notification settings - Fork 238
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
Error while loading supertoken from serverside functions #1768
Comments
I followed a different path for hunting the issue. Create de Superfluid Framework using the StaticJsonRpcProvider to avoid the previous errors I had about getting network:
Then, create an instance of a Supertoken by hand:
If we debug inside that code, then you get to:
StaticJsonRpcProvider do a send (ethers) y and then a getURL (ethers). The code inside the getURL:
Finally, it calls for the creation of a new URL (Node process internal). In the line: |
@philipandersson this can be closed. It is most likely an error on ethers side. I assisted @luisalrp with his project yesterday, and he is moving away from the SDK all together. |
Describe the bug:
Not possible to load a supertoken from serverside functions like nextjs 14 server components or cloudflare workers.
Environment (please complete the following information):
Steps To Reproduce:
Steps to reproduce the behavior:
Expected behavior:
I expected the same behavior as client side, since the code is the same. It should retrieve the flowrate and set it into the serverside label.
Actual behavior:
Client side function works ok, but server side function prompts the following error in the terminal:
Screenshots/Code Snippets:
If applicable, attach screenshots and/or copy code snippets where the problem is occurring to further help explain your problem.
Additional context:
It is virtually imposible to load a supertoken from serverside functions like nextjs 14 ones or cloudflare workers. I don't know why. I've found after so many hours tracking the issue that it was an ethers issue and they implemented a new method to create an ethers StaticJsonRpcProvider.
Screenshot from ethers documentation.
From my point of view Superfluid Framework is a great tool that abstracts most of complexity, but there are some edge cases like this that so many checks like the ones when loading a supertoken are in conflict with ethers 5.7.2 utilization from serverside.
I hope it helps and superfluid adoption increases.
Best,
Luis Alberto
The text was updated successfully, but these errors were encountered: