Skip to content

Nested list components using JSX expressions throw error #811

@TheOtterlord

Description

@TheOtterlord

What version of astro are you using?

2.6.6

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

None

What package manager are you using?

npm

What operating system are you using?

Linux

What browser are you using?

Firefox

Describe the Bug

This isn't a vital bug (at least not this reproduction) because it misuses li elements.

If you nest a list of li elements in a JSX expression, surrounded by an li element, Astro throws an error.

---
---

<html lang="en">
	<head>
		<meta charset="utf-8" />
		<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
		<meta name="viewport" content="width=device-width" />
		<meta name="generator" content={Astro.generator} />
		<title>Astro</title>
	</head>
	<body>
		<ul>
			<li>
				{
					[''].map(() => (
						<li></li>
					))
				}
			</li>
		</ul>
	</body>
</html>

What's the expected result?

Correctly render the elements

Link to Minimal Reproducible Example

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

Participation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P2: nice to haveNot breaking anything but nice to have (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions