Skip to content

🐛 BUG: Props and comment with export type Props<T> causes crash #1117

@feelixe

Description

@feelixe

Describe the Bug

A comment in the frontmatter with a text matching the props with a generic type causes astro check to crash.
For example:

---
// export type Props<T> = {}
export type Props<T> = {
  abc: number;
};
---

It's not clear to me exactly what the conditions are for the bug to occur, but it seems both the comment and the Props type must have a generic type.

Steps to Reproduce

  1. Open reproduced example.
  2. Wait for installation to complete.
  3. Run npm run check in terminal.
  4. Crash occurs.
  5. Look inside ./src/components/component.astro to see file that causes the issue.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-m2mgaw1s?file=src/components/component.astro,package.json&on=stackblitz

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions