Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails when exporting a type using MarkdownLayoutProps #763

Closed
1 task
phelipetls opened this issue Nov 13, 2022 · 11 comments
Closed
1 task

Build fails when exporting a type using MarkdownLayoutProps #763

phelipetls opened this issue Nov 13, 2022 · 11 comments
Assignees
Labels
- P2: has workaround Bug, but has workaround (priority)

Comments

@phelipetls
Copy link

What version of astro are you using?

1.6.6

Are you using an SSR adapter? If so, which one?

No

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

Exporting a type using MarkdownLayoutProps causes the following error.

[plugin:astro:build] Expected ">" but found "const"

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-yaiimj?file=src/pages/index.astro

Participation

  • I am willing to submit a pull request for this issue.
@MoustaphaDev

This comment was marked as outdated.

@phelipetls
Copy link
Author

Got it. To clarify I exported it to stop the @typescript-eslint/no-unused-vars rule from complaining, what should I do instead? Should I just configure the rule to not apply for this type in astro files?

@MoustaphaDev
Copy link
Member

Maybe you can use a // @ts-ignore ?

@phelipetls
Copy link
Author

Yes, suppressing the error is what I'm doing now, with // eslint-disable-next-line @typescript-eslint/no-unused-vars, but I was wondering if there was a better way to handle this.

I opened the issue because the error message seemed to me like a weird one, thought it might be a bug, but feel free to close if this is expected. Thanks!

@MoustaphaDev
Copy link
Member

MoustaphaDev commented Nov 13, 2022

Sorry, I'm not aware of a better way to handle this

@matthewp
Copy link
Contributor

@Princesseuh can you take a look if this error message can be improved?

@matthewp matthewp added the - P3: minor bug An edge case that only affects very specific usage (priority) label Nov 14, 2022
@Princesseuh
Copy link
Member

This seems to be a compiler bug, maybe something to do with the export + the generic argument confusing the compiler?

@bholmesdev
Copy link

@Princesseuh Yeah that sounds right. I recall seeing this error message on generic types before 🤷

@Princesseuh Princesseuh added - P2: nice to have Not breaking anything but nice to have (priority) - P2: has workaround Bug, but has workaround (priority) and removed - P3: minor bug An edge case that only affects very specific usage (priority) - P2: nice to have Not breaking anything but nice to have (priority) labels Mar 23, 2023
@Princesseuh
Copy link
Member

Princesseuh commented Mar 23, 2023

Moving to the compiler repo. fwiw, removing the export makes it work. Exporting Props is unnecessary (it does nothing for editor tooling and never has) and generally unwanted, so I consider this a good workaround in this case. The Astro ESLint plugin should handle this better.

@Princesseuh Princesseuh transferred this issue from withastro/astro Mar 23, 2023
@Princesseuh
Copy link
Member

Could be related to #554

@Princesseuh
Copy link
Member

Confirming that this is a duplicate of #554

@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: has workaround Bug, but has workaround (priority)
Projects
None yet
Development

No branches or pull requests

6 participants