[bug] ReferenceError: indexedDB is not defined
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
I also encountered this problem.
i'm also having the same issue if anyone can please tell.
Same, my existing dApp stopped working suddenly. I'm getting this non-stop logs
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.
If you're experiencing this, please share a reproducible example with specific dependency versions. RainbowKit doesn't interface with
IndexedDBdirectly, 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"
If you're experiencing this, please share a reproducible example with specific dependency versions. RainbowKit doesn't interface with
IndexedDBdirectly, 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]
Not sure if this helps, but this error started occurring in 2.2.3 with the below wagmi and viem dependencies:
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:
Not able to switch back to 2.2.5 because it has #2387
Do we have any update on this?
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.
same issue
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 ?
@DanielSinclair this bug is still happening with 2.2.9
this bug is still happening with 2.2.9
Still bug
this bug is still happening with 2.2.10