-
Notifications
You must be signed in to change notification settings - Fork 8
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
Issue when no wallet is attached to the browser #110
Changes from all commits
c283df5
b326883
4c896da
d8a19b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { http, createConfig } from "wagmi"; | ||
import { injected } from "wagmi/connectors"; | ||
import { walletConnect } from "wagmi/connectors"; | ||
import { walletConnect, coinbaseWallet } from "wagmi/connectors"; | ||
import { | ||
PUB_APP_DESCRIPTION, | ||
PUB_APP_NAME, | ||
|
@@ -10,6 +10,7 @@ import { | |
PUB_WALLET_ICON, | ||
PUB_WEB3_ENDPOINT, | ||
} from "@/constants"; | ||
import { mainnet } from "viem/chains"; | ||
|
||
// wagmi config | ||
const metadata = { | ||
|
@@ -20,18 +21,18 @@ const metadata = { | |
}; | ||
|
||
export const config = createConfig({ | ||
chains: [PUB_CHAIN], | ||
chains: [PUB_CHAIN, mainnet], | ||
ssr: true, | ||
transports: { | ||
[PUB_CHAIN.id]: http(PUB_WEB3_ENDPOINT, { batch: true }), | ||
[mainnet.id]: http(PUB_WEB3_ENDPOINT, { batch: true }), | ||
}, | ||
connectors: [ | ||
walletConnect({ | ||
projectId: PUB_WALLET_CONNECT_PROJECT_ID, | ||
metadata, | ||
showQrModal: false, | ||
}), | ||
injected({ shimDisconnect: true }), | ||
// coinbaseWallet({ appName: metadata.name, appLogoUrl: metadata.icons[0] }), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not enabled? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now coinbaseWallet only works without SSR. If we enable it, it fulls the console with errors. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we don't find a fix then we should consider rolling back enabling SSR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The warning/error appears in general in Next, doesn't matter if SSR in wagmi or not. To be clear, it does work. It just shows an error in the console because the backend fails to run that piece of the code. |
||
], | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we want to use the injected one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it comes by default with the Metamask id. If you add it, it shows metamask twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, nice catch then!