Open
Description
What version of @astrojs/compiler
are you using?
2.7.0
What package manager are you using?
pnpm
What operating system are you using?
macOS
Describe the Bug
In HTML, the following code:
<span>Hello</ span>
is invalid, but is corrected by the browser like this:
<span>Hello<!-- span-->
</span>
In the TSX output, writing the first snippet crashes the compiler.
panic: runtime error: index out of range [0] with length 0
goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderTsx(0x14bb950, 0x14ad040)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:248 +0x1b6
github.com/withastro/compiler/internal/printer.renderTsx(0x14bb950, 0x14acdc0)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:523 +0x52f
github.com/withastro/compiler/internal/printer.renderTsx(0x14bb950, 0x14acb40)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:147 +0xba
github.com/withastro/compiler/internal/printer.PrintToTSX({0x14920a8, 0x12}, 0x14acb40, {{0x3c3c4, 0x6}, {0x14d20c0, 0x3e}, {0x14d20c0, 0x3e}, {0x46f38, ...}, ...}, ...)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:30 +0x12
main.main.ConvertToTSX.func3({{}, 0x7ff800010000000d, 0x140c6a0}, {0x1434140, 0x2, 0x2})
./astro-wasm.go:263 +0xe
syscall/js.handleEvent()
syscall/js/func.go:100 +0x23
exit code: 2
Activity