Skip to content

[BUG] isConnected always returning false, when clearly connected #446

@patrick-streaming

Description

@patrick-streaming

Describe the bug

I have the following code:

'use client'

import { useEffect, useState } from 'react'
import { useAccount } from 'wagmi'

export default function Home() {
  const { isConnected, address, status } = useAccount()

  useEffect(() => {
    console.log(isConnected)
    console.log(address)
    console.log(status)
  }, [isConnected, address, status])

And on my UI, Metamask is clearly connected (my metamask, show it's connected to the site, and you can see the address of my metamask being console.logged out):

Image

Whenever I refresh the page, it just keeps saying not connected

To reproduce

  1. Use the import { useAccount } from 'wagmi' hook, and in a component, add:
export default function Home() {
  const { isConnected, address, status } = useAccount()

  useEffect(() => {
    console.log(isConnected)
    console.log(address)
    console.log(status)
  }, [isConnected, address, status])
  1. Connect your metamask with a connect button
  2. Refresh the page, it'll always have isConnected be false

Optionally, you can see this repo for more information.

Expected behavior

isConnected should be true, as my Metamask says it's true

Screenshots

See above

Environment details

nodejs: v23.5.0
"wagmi": "^2.14.9"
"connectkit": "^1.8.2",

Tagging @PatrickAlphaC

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions