fix(connectors): throw on empty or whitespace WalletConnect projectId#5031
fix(connectors): throw on empty or whitespace WalletConnect projectId#5031Zelys-DFKH wants to merge 1 commit intowevm:mainfrom
Conversation
Closes wevm#5030 Co-Authored-By: Zelys-DFKH <noreply@github.com>
🦋 Changeset detectedLatest commit: 9855118 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@Zelys-DFKH is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for the PR! Better if this is handled at the WalletConnect SDK-level |
|
Thanks for the feedback. Understood. This belongs at the SDK level. Closing in favor of that approach. |
|
Following your feedback, I've submitted the projectId validation fix upstream to WalletConnect/walletconnect-monorepo#7216 as you suggested. This ensures the fix benefits all SDKs that depend on EthereumProvider, not just wagmi. |
Closes #5030
The WalletConnect connector accepted an empty string or whitespace-only
projectIdwithout complaint. When that happened, the QR modal never appeared and connections failed silently. No error, no log, nothing. This comes up whenVITE_WC_PROJECT_ID(or the React/Next equivalent) is missing, or when a.envfile has a trailing newline that corrupts the value.The fix trims and checks
projectIdat connector creation and throws aBaseErrorimmediately if it's falsy. Fail at config time, not at user-click time.Changes
packages/connectors/src/walletConnect.ts— validateprojectIdat the top ofwalletConnect(), before any lazy provider initialization runspackages/connectors/src/walletConnect.test.ts— two tests covering empty string and whitespace-only