next-web3-boilerplate icon indicating copy to clipboard operation
next-web3-boilerplate copied to clipboard

useEagerConnect does not work on SSR

Open fsouzadi1995 opened this issue 4 years ago • 1 comments

Hi!

I'm not sure if I'm completely missing the point here, but it seems that useEagerConnect() does not currently work on Next.js or any prerendered site since the window.ethereumproperty cannot be accessed server-side.

I've tried both creating my own project from scratch and also cloned this one to confirm it.

I'm also getting the following console output:

MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.
For more information, see: https://eips.ethereum.org/EIPS/eip-1193

I'm quite new to SSR so I might be doing some stuff the wrong way.

fsouzadi1995 avatar Dec 10 '21 02:12 fsouzadi1995

Hey there!

So the console warning you're seeing is from the upstream library web3-react, this will be fixed in the newest version of web3-react which is currently under development.

Regarding useEagerConnect, you're correct this won't connect to your wallet while loading but should after the fact, are you seeing an error when using this? Or is it not working at all.

mirshko avatar Dec 13 '21 13:12 mirshko