Skip to content

Parse error when ImportsList contains comment with closing curly brace #92

@aomarks

Description

@aomarks

If there is a comment inside of an ImportsList, and that comment contains a }, then es-module-lexer v0.9.2 currently throws a parse error:

import { /** @type{HTMLElement} */ LionCombobox } from './src/LionCombobox.js';
//                              ^ Parse error

If there is no } inside the comment, then there is no parse error.

Found in the wild here: https://unpkg.com/@lion/combobox@0.8.4/lion-combobox.js

(Love this library by the way! We are using it in https://github.com/google/playground-elements which powers https://lit.dev/playground/ to do super fast bare module resolution. You can see the parse error as an inline red squiggly error in this example).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions