Skip to content

parseExpressionAt throws SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag even though the element is wrapped in an enclosing tag #127

@Momijiichigo

Description

@Momijiichigo

Target code:

(<div>
    <Header />
</div>)

The code below throws SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag even though the Header element is wrapped in an enclosing tag:

const MyParser = Parser.extend(
  jsx()
)
console.log(
  MyParser.parseExpressionAt(code, code.indexOf('<Header'), { ecmaVersion: 'latest', sourceType: "module" })
)

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