Skip to content

Conversation

jectychen
Copy link

@jectychen jectychen commented Dec 28, 2021

The judgment "isDef(this.$options.router)" can be more rigorous.
Since in some cases, the router can be null, which will cause the execute error.
And We have faced this situation in @testing-library/vue/render.js
BTW, this change have been seen in the vue-router-next.

@posva
Copy link
Member

posva commented Dec 28, 2021

Thanks! can you provide a simple reproduction of when this would fail? Or more context maybe? Why would the statement need to check for more than false values?

@posva
Copy link
Member

posva commented Feb 1, 2022

Closing due to inactivity. Please open a new issue with a reference to this one if you can follow up with more information.

@posva posva closed this Feb 1, 2022
@gaaamii
Copy link

gaaamii commented Mar 6, 2024

I met same problem with testing-library/vue@5, then I could avoid this issue with below.

render(MyComponent, { router: undefined }) // pass router option as undefined explicitly

I think this PR does not have to be merged because this problem occured in testing-library/vue@5 which is for EOL version of Vue, Vue@2.

But I comment for someone who uses same version as me. I would be happy if it is helpful to someone 😺

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

Successfully merging this pull request may close these issues.

3 participants