Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routeChangeComplete not correctly configured with useRouter #126

Closed
kylehotchkiss opened this issue Jul 15, 2021 · 1 comment · Fixed by #131
Closed

routeChangeComplete not correctly configured with useRouter #126

kylehotchkiss opened this issue Jul 15, 2021 · 1 comment · Fixed by #131
Labels
bug Something isn't working

Comments

@kylehotchkiss
Copy link
Member

Currently routeChangeComplete event listener is not connected to the useRouter() hook: https://github.com/patronage/bubs-next/blob/main/website/src/pages/_app.js#L22-L34

I found that it wasn't firing for me on page changes. I adjusted the syntax to follow the routeChangeComplete syntax in Next docs and then the page change events fired for me as expected. I don't understand why no error messages occurred with the current code configuration as this fails pretty silently. Since we've been using GTM which can track pageview events on its own, this wasn't showing in analytics data either.

@kylehotchkiss kylehotchkiss added the bug Something isn't working label Jul 15, 2021
kylehotchkiss added a commit that referenced this issue Jul 21, 2021
@ccorda
Copy link
Contributor

ccorda commented Jul 21, 2021

FWIW I just tried on another site and it worked no problem:
Screen Shot 2021-07-21 at 2 53 17 PM

From reading the PR, their reasoning is here:
vercel/next.js#16846

Glad we're updating to follow their syntax, but it's not like old sites will have broken analytics.

kylehotchkiss added a commit that referenced this issue Jul 26, 2021
* resolve #126

* "react-hooks/exhaustive-deps": "off"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants