Closed winsoroaks closed 8 months ago
@winsoroaks I came across this error the other day and recreated it just by having Coinbase Wallet set up in the config (does not need to be using ConnectKit for this error to happen).
If you could confirm for me, does this still occur if you include a coinbaseWallet
connector inside your wagmi config?
I've pinged the wagmi team, and am about to escalate it to the Coinbase team.
I recreated this in stackblitz. You can see this same error when running npm run build
.
https://stackblitz.com/edit/stackblitz-starters-htymxq?file=app%2Fweb3provider.tsx
This issue doesn't have anything to do with the ConnectKit library, so going to close this issue. But I've alerted CBW and the wagmi team about this issue.
@winsoroaks If you need a temporary solution, you can override the ConnectKit connectors to remove coinbase wallet (or all the connectors) on the server to help avoid these build issues.
const ckConfig = getDefaultConfig({
// your config
});
const config = createConfig({
...ckConfig,
connectors: [
typeof window !== 'undefined'
? ckConfig.connectors
: [],
]
});
@winsoroaks this should be fixed by including ssr: true
in your wagmi config, for example:
const wagmiConfig = createConfig({
getDefaultConfig({
ssr :true, // be sure to include this if you are using SSR
chains: [arbitrum],
transports: {
[arbitrum.id]: http(),
},
walletConnectProjectId: projectId,
appDescription: "hello",
appUrl: "https://hello",
appIcon: "https://hello/logo.png",
}),
});
Describe the bug
Wagmi config with getDefaultConfig is breaking. im running into
when i copied and pasted the starter code. i unblocked myself by removing the
getDefaultConfig
.To reproduce
Expected behavior Should be able to build without the localStorage undefined error.
Environment details viem: ^2.7.6, wagmi: ^2.5.6,