question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] ConnectorNotFoundError triggered when query params are present or when navigating in Nextjs app

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.4.12

Current Behavior

When opening a nextjs page with any query params in the url, or when navigating to other pages using Next/link, connector is undefined and signer is null.

This leads to bugs when trying to connect wallet (in my case RainbowKit popup getting stuck on “waiting for connection”, or triggering ConnectorAlreadyConnectedError) as well as impossibility to sign messages via useSignMessage.

Same behaviour as #546, so the issues are probably related

Expected Behavior

Navigating through pages or adding query params shouldn’t influence connector or signer

Steps To Reproduce

  1. Go on this page https://wagmi-connector-debug.vercel.app/?asd=123
  2. Verify that connecting and signing message will not work due to query param

Same behaviour can be triggered by going to https://wagmi-connector-debug.vercel.app/ and then navigating to the secondary page

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

Repo: https://github.com/jjranalli/wagmi-connector-debug

Deployment link: https://wagmi-connector-debug.vercel.app/

Anything else?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jjranallicommented, Jun 13, 2022

Yes that doesn’t seem to work, also I’m calling createClient in the global scope.

Will provide a repo soon and reopen the issue, thanks.

0reactions
jjranallicommented, Jun 13, 2022

oh 🤦‍♂️ that fixed it. Apologies for opening the issue and thanks for catching that!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Double navigation if any query params is present #20201
Bug report Loading a URL with query params as http://localhost:3000/?2 causes double loading: load the page http://localhost:3000/?2 ...
Read more >
Next.js router is returning query parameters as undefined on ...
Just found out what is the solution to my problem: From: https://nextjs.org/docs/api-reference/next/router#router-object.
Read more >
[Solution] NextJS Router Query Not Working in useEffect
If you ever tried to get query params from next/router in useEffect , you probably have this similar issue which the params are...
Read more >
Dynamic Routes - Next.js
Dynamic Routes are pages that allow you to add custom params to your URLs. ... However, route parameters will override query parameters with...
Read more >
Fixing Next.js router query param returning undefined on ...
If you're getting undefined query params in nextjs on the first render ... Next.js will trigger an update to your application to provide...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found