Skip to content

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

Closed
@sandro78

Description

@sandro78

Subject of the issue

Undesired errors at console during tests run:

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

Steps to reproduce

Was faced with above issue and found place at code which rises it:

function isComponentOptions(c) {
return typeof c === 'object' && (c.template || c.render)
}

In fact typeof null in JS also returns 'object' - have you expected this guys?)))

Expected behaviour

Suggest to change this place in way:

return !!c && typeof c === 'object' && (c.template || c.render)

Actual behaviour

Tons of errors at console like:
[Vue warn]: Error in render: "TypeError: Cannot read property 'template' of null"

Possible Solution

Haven't found workaround yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions