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

Using the browser back button throws a TypeError #19

Closed
christianrank opened this issue Jun 12, 2019 · 3 comments · Fixed by #20
Closed

Using the browser back button throws a TypeError #19

christianrank opened this issue Jun 12, 2019 · 3 comments · Fixed by #20

Comments

@christianrank
Copy link

When using the browser back button, routing still works, but it throws an error:

Uncaught TypeError: Cannot read property 'apply' of undefined
    at Router._bps (patchRouter.js:72)
    at Router.onPopState (router.js:36)

It relates to the line where _unpatchedBeforePopStateCallback is called in patchRouter.js, which is not defined.

I did some research and found out that _beforePopState is not there anymore in Next.js:
vercel/next.js@83334f1#diff-a33404ba5698b3b45e69c2b3f2d3b48bL38

Then I tried replacing _beforePopState with _bps in patchRouter.js, but that did not help.

Maybe someone has an idea.

@danielr18
Copy link
Owner

I'll look into this today, thanks for reporting

@danielr18
Copy link
Owner

I just released 1.0.2, can you let me know if it's working as expected for you?

@christianrank
Copy link
Author

Wow, that was fast.

It fixes our issue. Thanks 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants