rainbowkit icon indicating copy to clipboard operation
rainbowkit copied to clipboard

[bug] ReferenceError: indexedDB is not defined

Open Barabazs opened this issue 6 months ago • 16 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

RainbowKit Version

2.2.8

wagmi Version

2.15.6

Current Behavior

Running the example repo results in the following error: unhandledRejection: [ReferenceError: indexedDB is not defined]

Console output of next dev

> next dev

   â–² Next.js 15.3.4
   - Local:        http://localhost:3000
   - Network:      http://172.17.0.2:3000

 ✓ Starting...
 ✓ Ready in 2.1s
 â—‹ Compiling / ...
 ✓ Compiled / in 31.2s (6938 modules)
[ReferenceError: indexedDB is not defined]
 ⨯ unhandledRejection: [ReferenceError: indexedDB is not defined]
 ⨯ unhandledRejection:  [ReferenceError: indexedDB is not defined]
[ReferenceError: indexedDB is not defined]
 ⨯ unhandledRejection: [ReferenceError: indexedDB is not defined]

Expected Behavior

No response

Steps To Reproduce

No response

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

Barabazs avatar Jun 26 '25 11:06 Barabazs

I also encountered this problem.

miaoxn avatar Jun 26 '25 14:06 miaoxn

i'm also having the same issue if anyone can please tell.

rakeshquotus avatar Jul 07 '25 06:07 rakeshquotus

Same, my existing dApp stopped working suddenly. I'm getting this non-stop logs

Image

kurays015 avatar Jul 07 '25 10:07 kurays015

If you're experiencing this, please share a reproducible example with specific dependency versions. RainbowKit doesn't interface with IndexedDB directly, so I suspect this is related to a dependency in your project.

DanielSinclair avatar Jul 07 '25 15:07 DanielSinclair

If you're experiencing this, please share a reproducible example with specific dependency versions. RainbowKit doesn't interface with IndexedDB directly, so I suspect this is related to a dependency in your project.

I’m also encountering the same error.

Here is the log:

⨯ unhandledRejection:  ReferenceError: indexedDB is not defined
    at new Te (.next/server/chunks/ssr/43ccb_@walletconnect_core_dist_index_es_87fb7aa7.js:3032:779)
    at new Ee (.next/server/chunks/ssr/27f0d_@walletconnect_sign-client_dist_index_es_ea69369c.js:2329:32)
    at Ee.init (.next/server/chunks/ssr/27f0d_@walletconnect_sign-client_dist_index_es_ea69369c.js:2332:19)
    at initProvider (../../src/walletConnect.ts:251:38)
    at async Object.getProvider (../../src/walletConnect.ts:271:20)
    at async Object.setup (../../src/walletConnect.ts:118:23)

Here are my package versions:

"@rainbow-me/rainbowkit": "2.2.8",
"viem": "2.23.9",
"wagmi": "2.14.15"

particle4dev avatar Jul 08 '25 03:07 particle4dev

If you're experiencing this, please share a reproducible example with specific dependency versions. RainbowKit doesn't interface with IndexedDB directly, so I suspect this is related to a dependency in your project.

As mentioned in the OP, this was with your example repo:

Running the example repo results in the following error: unhandledRejection: [ReferenceError: indexedDB is not defined]

Barabazs avatar Jul 08 '25 06:07 Barabazs

Not sure if this helps, but this error started occurring in 2.2.3 with the below wagmi and viem dependencies:

Image

Got fixed in 2.2.5, but I think it was reintroduced in 2.2.7 or 2.2.6 again, we currently have dependencies like this and we get the error:

Image

Not able to switch back to 2.2.5 because it has #2387

technophile-04 avatar Jul 08 '25 06:07 technophile-04

Do we have any update on this?

Anoop072001 avatar Jul 15 '25 19:07 Anoop072001

I've also faced this issue in some of my projects that use the latest versions of wagmi and Rainbowkit This issue occurs during SSR when using any wallet that calls getProvider from walletConnect.ts, or more broadly, any wallet relying on Wallet Connect. The problem comes @walletconnect/ethereum-provider package that wagmi imports inside the initProvider function.

Here's the solution I am currently using:

{
      groupName: "Recommended",
      wallets: [
        injectedWallet,

        // We would run into `ReferenceError: indexedDB is not defined` during SSR without the check
        ...(typeof indexedDB !== "undefined"
          ? [trustWallet, metaMaskWallet, walletConnectWallet]
          : []),
      ],
    }

This effectively prevents WalletConnect-related wallets from initializing during SSR.

eliezerbasubi avatar Jul 25 '25 12:07 eliezerbasubi

same issue

evan976 avatar Jul 26 '25 01:07 evan976

I think we need to up the wagmi version here in Rainbowkit?

https://github.com/wevm/wagmi/releases/tag/wagmi%402.16.1

They seemed to update the version 4 days ago which is same as when walletConnect launched new version https://github.com/WalletConnect/walletconnect-monorepo/releases/tag/%40walletconnect%2Fsigner-connection%402.21.6 ?

technophile-04 avatar Aug 04 '25 13:08 technophile-04

@DanielSinclair this bug is still happening with 2.2.9

Barabazs avatar Nov 08 '25 17:11 Barabazs

this bug is still happening with 2.2.9

iNuanfeng avatar Nov 09 '25 15:11 iNuanfeng

Still bug

karasbuilder avatar Nov 20 '25 07:11 karasbuilder

this bug is still happening with 2.2.10

miaoxn avatar Dec 09 '25 14:12 miaoxn