You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cp env.example env.local and modify the environment variables if needed.
run the PoC with 'pnpm dev'
Enter the dapp using the browser, connect the wallet and click on "get flow rate" button.
Open developer tools and watch the console output.
Go to terminal and see the error.
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:
Error getting flow info SFError: SuperToken Initialization Error: There was an error initializing the SuperToken
Caused by: {
"name": "Error",
"code": "CALL_EXCEPTION",
"message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x8aE68021f6170E5a766bE613cEA0d75236ECCa9a","data":"0x95d89b41","accessList":null}, error={"reason":"missing response","code":"SERVER_ERROR","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x8ae68021f6170e5a766be613cea0d75236ecca9a\\",\\"data\\":\\"0x95d89b41\\"},\\"latest\\"],\\"id\\":43,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","serverError":{},"url":"https://goerli.gateway.tenderly.co"}, code=CALL_EXCEPTION, version=providers/5.7.2)"
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.
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:
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:
const sf = await Framework.create({
chainId: chainId,
provider: new ethers.providers.StaticJsonRpcProvider(process.env.RPCPROVIDER_URL, 'goerli'), // -> Crea un options interno que solo tiene "url"
});
StaticJsonRpcProvider do a send (ethers) y and then a getURL (ethers). The code inside the getURL:
if (options.skipFetchSetup !== true) { // -> Not exists, it just exists the "url"
request.mode = "cors"; // no-cors, cors, same-origin
request.cache = "no-cache"; //default, no-cache, reload, force-cache, only-if-cached
request.credentials = "same-origin"; // include, same-origin, omit
request.redirect = "follow"; // manual,follow, error
request.referrer = "client"; // no-referrer, *client
}
Finally, it calls for the creation of a new URL (Node process internal). In the line: const href = bindingUrl.parse(input, base); // input is the referrer, "client"
When href is empty -> "Referrer 'client' is not a valid URL." (it doesn't even make the RPC call)"
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: