-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] useRouter().push
will return TypeError: Cannot read properties of null (reading 'parentNode')
#1874
Comments
Ah, sorry, dup with #1319 |
No, I looked again, #1319 is caused by double |
This is because you are pushing while the view is being created which is not supported because it doesn’t make sense to push right at the same time the component mounts as it leads to just leave the page right away. If you have some logic around it, use a navigation guard instead |
Oh also, you need to change the syntax you are using |
Makes sense. Thanks :) |
Reproduction
https://github.com/zyxkad/vue-router-issue
Steps to reproduce the bug
git clone https://github.com/zyxkad/vue-router-issue && cd vue-router-issue
npm ci && npm run dev
About
tag to switch to another pageHome
Expected behavior
The app should work without any errors
Actual behavior
Additional information
No response
The text was updated successfully, but these errors were encountered: