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

🐛 BUG: Using windows line endings causes astro compiler crash #529

Closed
hinnerkoetting opened this issue May 8, 2023 · 1 comment
Closed

Comments

@hinnerkoetting
Copy link

Describe the Bug

We are running into an issue with the astro compiler that only happens on windows machines (it's working on macs and linux).
It goes away on windows once we change the line ending from CRLF (windows) to LF (linux).

It only happens in one file that is generated by another astro file. Unfortunately, I cannot share the complete file (I could share parts if necessary).

The issue occurs since an update we did last week (astro-compiler 1.3.1 to 1.4.0) .

Stacktrace

11:19:14 [build] Building static entrypoints...
[astro:build] runtime error: index out of range [57] with length 57
file: C:/develop/git/.../src/modules/shared/components/card/HeroPicture.astro:undefined:undefined
 error   runtime error: index out of range [57] with length 57
  Hint:
    This is almost always a problem with the Astro compiler, not your code. Please open an issue at https://astro.build/issues/compiler.
  File:
    C:/develop/git/.../src/modules/shared/components/card/HeroPicture.astro
  Stacktrace:
goroutine 75 [running]:
runtime/debug.Stack()
        runtime/debug/stack.go:24 +0x6
github.com/withastro/compiler/internal_wasm/utils.ErrorToJSError(0x6aa5a0, {0x18fa6c0, 0x7ffc68})
        github.com/withastro/compiler/internal_wasm/utils/utils.go:68 +0x2
main.Transform.func1.1.1.1()
        ./astro-wasm.go:284 +0x5
panic({0x2dae0, 0x7ffc68})
        runtime/panic.go:884 +0x29
github.com/withastro/compiler/internal/printer.(*printer).printTextWithSourcemap(0x56b758, {0x78bb00, 0x39}, {0xf04})
        github.com/withastro/compiler/internal/printer/printer.go:72 +0x25
github.com/withastro/compiler/internal/printer.render1(0x56b758, 0x577400, {0x0, 0x0, 0x4, 0x1, {{0x10c8530, 0x8}, {0x101cd80, 0x7a}, ...}, ...})
        github.com/withastro/compiler/internal/printer/print-to-js.go:320 +0x18f
github.com/withastro/compiler/internal/printer.render1(0x56b758, 0x577040, {0x0, 0x0, 0x3, 0x1, {{0x10c8530, 0x8}, {0x101cd80, 0x7a}, ...}, ...})
        github.com/withastro/compiler/internal/printer/print-to-js.go:696 +0x53d
github.com/withastro/compiler/internal/printer.render1(0x56b758, 0x576c80, {0x0, 0x0, 0x2, 0x1, {{0x10c8530, 0x8}, {0x101cd80, 0x7a}, ...}, ...})
        github.com/withastro/compiler/internal/printer/print-to-js.go:696 +0x53d
github.com/withastro/compiler/internal/printer.render1(0x56b758, 0x576a00, {0x0, 0x0, 0x1, 0x1, {{0x10c8530, 0x8}, {0x101cd80, 0x7a}, ...}, ...})
        github.com/withastro/compiler/internal/printer/print-to-js.go:696 +0x53d
github.com/withastro/compiler/internal/printer.render1(0x56b758, 0x576000, {0x1, 0x0, 0x0, 0x1, {{0x10c8530, 0x8}, {0x101cd80, 0x7a}, ...}, ...})
        github.com/withastro/compiler/internal/printer/print-to-js.go:121 +0xc1
github.com/withastro/compiler/internal/printer.printToJs(0x56b758, 0x576000, 0x1, {{0x10c8530, 0x8}, {0x101cd80, 0x7a}, {0x78b980, 0x35}, {0x4866a8, ...}, ...})
        github.com/withastro/compiler/internal/printer/print-to-js.go:72 +0x3
github.com/withastro/compiler/internal/printer.PrintToJS({0x54c800, 0x2737}, 0x576000, 0x1, {{0x10c8530, 0x8}, {0x101cd80, 0x7a}, {0x78b980, 0x35}, ...}, ...)
        github.com/withastro/compiler/internal/printer/print-to-js.go:53 +0xc
main.Transform.func1.1.1()
        ./astro-wasm.go:401 +0x38
created by main.Transform.func1.1
        ./astro-wasm.go:280 +0x14


error Command failed with exit code 1.

Steps to Reproduce

.

@Princesseuh
Copy link
Member

Closing as duplicate of withastro/compiler#786

Additionally, this repo is about the editor tooling (as in, ex: VS Code integration) 😅

@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2023
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