Skip to content

TypeError: Cannot read property 'type' of undefined #1000

@Novynn

Description

@Novynn

Came across this problem while trying to optimize a script that requires vue-router@3.0.1. It looks like this line is the culprit:

if (bodyNode.consequent && bodyNode.consequent.body) {

I've fixed it locally by adding && bodyNode.consequent.body.length to the end of the if statement linked because consequent.body is an object not an array in this case ({type: 'BlockStatement', body: {...}}).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions