Link to minimal reproducible example
We're seeing this in production via Sentry on our Next.js portal app (app.sablier.com). The warning is emitted from the WalletConnect WebSocket transport when the relay at wss://relay.walletconnect.org fails and reconnects repeatedly, stacking listeners beyond the default limit of 10.
The relevant minified frame from our Sentry capture:
setMaxListeners(10)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${I(this.url)}`));return this
This happens on page load / wallet connection without any special setup — just standard AppKit + wagmi integration in a Next.js App Router app.
Steps to Reproduce
- Integrate AppKit with wagmi in a Next.js app
- Open the app on Mobile Safari / iOS WKWebView (iPhone, iOS 18.6)
- Navigate to any page that initializes AppKit (e.g. an airdrops campaign page)
- Observe
MaxListenersExceededWarning in the console and/or Sentry captures of WebSocket connection failed for host: wss://relay.walletconnect.org
Most frequently observed on Mobile Safari UI/WKWebView on iOS, but likely affects all browsers when the relay connection is unstable.
Summary
The internal WebSocket class in @walletconnect/core calls setMaxListeners(10) but appears to stack error/close/open listeners across reconnection attempts without removing stale ones. When the relay is flaky (common on mobile networks), this quickly exceeds the limit and emits MaxListenersExceededWarning.
Expected: Listeners should be cleaned up before each reconnection attempt, or the max listener count should be raised to match the actual reconnection strategy.
Actual: Listeners accumulate, triggering MaxListenersExceededWarning and polluting error monitoring with noise.
List of related npm package versions
@reown/appkit: 1.8.17
@reown/appkit-adapter-wagmi: 1.8.17
@reown/appkit-adapter-solana: 1.8.17
@walletconnect/core: 2.23.2 (transitive)
@walletconnect/sign-client: 2.23.2 (transitive)
wagmi: 2.19.5
viem: 2.44.2
next: 16 (App Router)
react: 19.3.0
Node.js Version
v25.6.0
Package Manager
bun@1.3.8
Link to minimal reproducible example
We're seeing this in production via Sentry on our Next.js portal app (app.sablier.com). The warning is emitted from the WalletConnect WebSocket transport when the relay at
wss://relay.walletconnect.orgfails and reconnects repeatedly, stacking listeners beyond the default limit of 10.The relevant minified frame from our Sentry capture:
This happens on page load / wallet connection without any special setup — just standard AppKit + wagmi integration in a Next.js App Router app.
Steps to Reproduce
MaxListenersExceededWarningin the console and/or Sentry captures ofWebSocket connection failed for host: wss://relay.walletconnect.orgMost frequently observed on Mobile Safari UI/WKWebView on iOS, but likely affects all browsers when the relay connection is unstable.
Summary
The internal WebSocket class in
@walletconnect/corecallssetMaxListeners(10)but appears to stackerror/close/openlisteners across reconnection attempts without removing stale ones. When the relay is flaky (common on mobile networks), this quickly exceeds the limit and emitsMaxListenersExceededWarning.Expected: Listeners should be cleaned up before each reconnection attempt, or the max listener count should be raised to match the actual reconnection strategy.
Actual: Listeners accumulate, triggering
MaxListenersExceededWarningand polluting error monitoring with noise.List of related npm package versions
@reown/appkit: 1.8.17@reown/appkit-adapter-wagmi: 1.8.17@reown/appkit-adapter-solana: 1.8.17@walletconnect/core: 2.23.2 (transitive)@walletconnect/sign-client: 2.23.2 (transitive)wagmi: 2.19.5viem: 2.44.2next: 16 (App Router)react: 19.3.0Node.js Version
v25.6.0
Package Manager
bun@1.3.8