Skip to content

vue-template-compiler fails when parsing a template with a comment as a root node. #9407

Closed
@elevatebart

Description

@elevatebart

Version

2.5.22

Reproduction link

https://codesandbox.io/s/52k2p9po54

Steps to reproduce

Go to the codesandbox.
Try to parse the given template with comments on.

<template>
 <!-- here is a nice component template -->
 <button class="buttonComponent">click</button>
</template>

What is expected?

The comment AST node should be attached to the root object.

What is actually happening?

node_modules/vue-template-compiler/build.js:2469:21)
TypeError: Cannot read property 'children' of undefined

(currentParent is undefined)

I am going to try my hand at a PR. Wish me luck ;)

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