Skip to content

fix: add wagmi v3 dedup override to prevent dual-context runtime error#733

Open
vinzenzLIFI wants to merge 2 commits into
mainfrom
fix/dedup-wagmi-v3
Open

fix: add wagmi v3 dedup override to prevent dual-context runtime error#733
vinzenzLIFI wants to merge 2 commits into
mainfrom
fix/dedup-wagmi-v3

Conversation

@vinzenzLIFI
Copy link
Copy Markdown
Contributor

Which Linear task is linked to this PR?

N/A — regression fix discovered during E2E test setup.

Why was it implemented this way?

After the chore: bump packages (#728) PR, two copies of wagmi@3 ended up being installed across the workspace:

  • wagmi@3.6.11 — resolved for @lifi/widget-provider-ethereum's wagmi: ^3.x peer dep
  • wagmi@3.6.12 — resolved for example apps that explicitly pin wagmi: ^3.6.12

When these examples are built by Vite, both copies end up in the bundle. The WagmiProvider from wagmi@3.6.11 and useConfig from wagmi@3.6.12 use different React context objects, so useConfig cannot find the provider and throws WagmiProviderNotFoundError at runtime. This caused the widget error boundary to fire immediately on page load.

The fix adds a single line to pnpm-workspace.yaml:

wagmi: '>=3.6.12'

This collapses all wagmi@3 resolutions to a single 3.6.12 copy across the workspace. No workspace package directly depends on wagmi@2.x, so this does not affect other packages.

Visual showcase (Screenshots or Videos)

N/A — the visible symptom before the fix was an immediate "Something went wrong!" error boundary on affected examples (nft-checkout, vite-iframe, vite-iframe-wagmi).

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the Widget API or adds new features that require documentation, I have updated the documentation in the public-docs repository.

Made with Cursor

@effie-ms effie-ms had a problem deploying to widget-test-pr-733 May 18, 2026 10:56 — with GitHub Actions Failure
@effie-ms effie-ms self-requested a review May 18, 2026 11:03
Two copies of wagmi@3 (3.6.11 and 3.6.12) were being bundled together
in examples that use @lifi/widget-provider-ethereum. The WagmiProvider
from one copy and useConfig from the other do not share the same React
context, causing a WagmiProviderNotFoundError at runtime.

Add a pnpm workspace override to collapse all wagmi@3.x to >=3.6.12
so a single copy is resolved across the workspace.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread pnpm-workspace.yaml Outdated
- 'packages/*'
- 'examples/*'
overrides:
wagmi: '>=3.6.12'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would vote for ^3.6.12 here, because usually we update major versions of wagmi manually (lots of breaking changes).
But I don't think we would update it blindly in any case even with >=, so for this particular use case it is just a note, optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants