Skip to content

πŸ› BUG: astro check cannot parse fileΒ #1119

@reisi007

Description

@reisi007

Describe the Bug

error astro(1000): The Astro compiler encountered an unknown error while transform this file to TSX. Please create an issue with your code and the error shown in the server's logs: https://github.com/withastro/language-tools/issues

WORKING Pagination.astro

Steps to Reproduce

The Astro JSX compiler has a problem parsing this file.

Only effects Astro check, astro build is fine and the generated files seem to be working just fine....

FAILING Pagination.astro

`panic: runtime error: index out of range [0] with length 0

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderTsx(0x1413950, 0x15623c0)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:248 +0x1b6
github.com/withastro/compiler/internal/printer.renderTsx(0x1413950, 0x1562140)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:523 +0x52f
github.com/withastro/compiler/internal/printer.renderTsx(0x1413950, 0x14c9e00)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:523 +0x52f
github.com/withastro/compiler/internal/printer.renderTsx(0x1413950, 0x14c9b80)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:523 +0x52f
github.com/withastro/compiler/internal/printer.renderTsx(0x1413950, 0x14c9900)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:523 +0x52f
github.com/withastro/compiler/internal/printer.renderTsx(0x1413950, 0x14c9540)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:147 +0xba
github.com/withastro/compiler/internal/printer.PrintToTSX({0x152b200, 0x409}, 0x14c9540, {{0x3c3c4, 0x6}, {0x145c6e0, 0x42}, {0x145c6e0, 0x42}, {0x46f38, ...}, ...}, ...)
github.com/withastro/compiler/internal/printer/print-to-tsx.go:30 +0x12
main.main.ConvertToTSX.func3({{}, 0x7ff800010000004b, 0x140c500}, {0x1434200, 0x2, 0x2})
./astro-wasm.go:263 +0xe
syscall/js.handleEvent()
syscall/js/func.go:100 +0x23
exit code: 2
There was an error transforming d:/Github/astro-reisinger.pictures/src/components/Pagination.astro to TSX. An empty file will be returned instead. Please create an issue: https://github.com/withastro/language-tools/issues
Error: TypeError: Cannot read properties of undefined (reading 'map').
D:\Github\astro-reisinger.pictures\node_modules@astrojs\compiler\dist\node\sync.cjs:1
`

"astro": "^4.8.3"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions