Troubleshooting
This page covers common issues you may encounter when using the DogeOS SDK and how to resolve them.
TypeScript Errors
”Property does not exist on type ‘undefined’”
Problem: TypeScript error when accessing hook return values.
Cause: Hook functions may be undefined before wallet connection.
Solution: Check for existence before calling:
const { signMessage } = useAccount()
// Wrongawait signMessage({ message: "Hello" })
// Correct - use optional chainingawait signMessage?.({ message: "Hello" })
// Or explicit checkif (signMessage) { await signMessage({ message: "Hello" })}“Property ‘request’ does not exist on type ‘undefined’”
Problem: Trying to use currentProvider before connection.
Solution: Check if provider exists:
const { currentProvider } = useAccount()
if (currentProvider) { const chainId = await currentProvider.request({ method: "eth_chainId" })}“Type ‘Chain’ is not assignable to type ‘Chain’”
Problem: Type conflict between viem Chain and DogeOS Chain.
Solution: The types are compatible. Ensure correct imports:
import { mainnet, base } from "viem/chains"import type { Chain } from "@dogeos/dogeos-sdk"
// Both work in configconst config = { clientId: "YOUR_CLIENT_ID", chains: { evm: [mainnet, base] },}Runtime Issues
switchChain returns false
Problem: Chain switch failed silently.
Cause: switchChain() returns Promise<boolean>, not Promise<void>.
Solution: Check the return value:
const success = await switchChain({ chainType: "evm", chainInfo: base })if (!success) { console.error("Chain switch failed")}signMessage/signInWithWallet always undefined
Problem: Functions are undefined even when trying to use them.
Cause: These functions only exist when a wallet is connected.
Solution: Check connection state first:
const { signMessage } = useAccount()const { isConnected } = useWalletConnect()
if (isConnected && signMessage) { await signMessage({ message: "Hello" })}Embedded Wallet Issues
Blank embed
Problem: WalletConnectEmbed renders nothing.
Cause: Provider not mounted or missing client ID.
Solution: Ensure WalletConnectProvider wraps your app and clientId is set:
import { WalletConnectProvider, WalletConnectEmbed } from "@dogeos/dogeos-sdk"import "@dogeos/dogeos-sdk/style.css"
const config = { clientId: "YOUR_CLIENT_ID" }
export function App() { return ( <WalletConnectProvider config={config}> <WalletConnectEmbed /> </WalletConnectProvider> )}No wallets listed
Problem: Wallet selection shows no options.
Cause: Configuration missing supported chains or connectors.
Solution: Verify your configuration includes chains:
import { mainnet } from "viem/chains"
const config = { clientId: "YOUR_CLIENT_ID", chains: { evm: [mainnet] },}Unexpected view displayed
Problem: Embedded wallet shows wrong screen.
Cause: The view prop is forcing a specific view.
Solution: Remove the view prop to let the SDK control the flow:
// Let SDK manage views<WalletConnectEmbed />
// Only use view prop for specific use cases<WalletConnectEmbed view={ModalView.WalletList} />Connection Issues
Modal not opening
Problem: openModal() does nothing.
Cause: Provider not properly initialized.
Solution: Check that the provider is mounted and styles are imported:
import { WalletConnectProvider } from "@dogeos/dogeos-sdk"import "@dogeos/dogeos-sdk/style.css" // Required for modal styling
const config = { clientId: "YOUR_CLIENT_ID" }
export function Providers({ children }) { return <WalletConnectProvider config={config}>{children}</WalletConnectProvider>}Connection rejected
Problem: Wallet connection fails immediately.
Cause: User rejected the connection or wallet not installed.
Solution: Check the error state from useWalletConnect:
const { error, isConnecting } = useWalletConnect()
if (error) { console.error("Connection failed:", error)}See Also
- Getting Started - Initial setup and configuration
- Types & Enums - Type definitions reference
- Hooks & Components - API reference