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

export type Props with a new line and intersection causes a build error #5614

Closed
1 task
itsMapleLeaf opened this issue Dec 16, 2022 · 1 comment
Closed
1 task

Comments

@itsMapleLeaf
Copy link
Contributor

What version of astro are you using?

1.6.15

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

None

What package manager are you using?

pnpm

What operating system are you using?

Windows

Describe the Bug

The following fail with an "Unexpected &" error:

---
export type Props = { 
	a?: number
} & {};
---
---
export type Props = {
  a?: number } & {};
---
---
export type Props = { a?: number
} & {};
---
---
export type Props = {
	a?: number
} & Base;
type Base = { b?: string }
---

This builds successfully:

---
export type Props = { a?: number } & {};
---
---
type Base = { b?: string }
export type Props = {
	a?: number
} & Base;
---
<p>hello</p>

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-j2wy3d?file=src%2Fpages%2Findex.astro&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
itsMapleLeaf added a commit to itsMapleLeaf/site-kit that referenced this issue Dec 16, 2022
@Princesseuh
Copy link
Member

Duplicate of withastro/compiler#554

(Also, exporting Props is not necessary, defining it is enough)

@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants