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

fix(test-utils): verify object not null for typeof #1897

Conversation

ataias
Copy link
Contributor

@ataias ataias commented Aug 19, 2021

Using vue-test-utils may cause several messages of the sort

[Vue warn]: Error in render: "TypeError: Cannot read property 'template' of null"

Such messages stemmed from the isComponentOptions method call. It
seems it received a null object and typeof null is object, so this
error propagates to users of the library.

This patch does not look for the reason a null object was sent in the
first place, but it avoids the error propagation.

close #1805

Using vue-test-utils may cause several messages of the sort
```
[Vue warn]: Error in render: "TypeError: Cannot read property 'template' of null"
```

Such messages stemmed from the `isComponentOptions` method call. It
seems it received a null object and `typeof null` is object, so this
error propagates to users of the library.

This patch does not look for the reason a null object was sent in the
first place, but it avoids the error propagation.

close vuejs#1805
@lmiller1990 lmiller1990 merged commit dace7f1 into vuejs:dev Oct 29, 2021
@ataias ataias deleted the fix/issue-1805/verify-null-before-calling-property branch October 29, 2021 10:07
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 this pull request may close these issues.

[Vue warn]: Error in render: "TypeError: Cannot read property 'template' of null"
2 participants