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: runtime error: index out of range [0] with length 0 #880

Closed
enriquelau opened this issue Oct 28, 2023 · 0 comments · Fixed by #891
Closed

🐛 BUG: runtime error: index out of range [0] with length 0 #880

enriquelau opened this issue Oct 28, 2023 · 0 comments · Fixed by #891
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@enriquelau
Copy link

What version of @astrojs/compiler are you using?

Don't know

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

Reproducible by adding import Navigation from '../components/Navigation.astro'; to the index.astro file AND adding in the body. These are the contents of the file"

1 ---
2 import '../styles/global.css';
3 import Navigation from '../components/Navigation.astro';
4 ---
5
6
7
8
9
10
11
12
13
14
15 <title>Astro</title>
16
17
18

Astro


19

My Astro Site


20
21

This is the output from the web browser:

goroutine 48 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x6
github.com/withastro/compiler/internal_wasm/utils.ErrorToJSError(0x6d9320, {0xb26458, 0x6f02e8})
github.com/withastro/compiler/internal_wasm/utils/utils.go:68 +0x2
main.Transform.func1.1.1.1()
./astro-wasm.go:290 +0x5
panic({0x2db80, 0x6f02e8})
runtime/panic.go:884 +0x29
github.com/withastro/compiler/internal.inBodyIM(0x6d9440)
github.com/withastro/compiler/internal/parser.go:1157 +0x658
github.com/withastro/compiler/internal.(*parser).parseCurrentToken(0x6d9440)
github.com/withastro/compiler/internal/parser.go:2968 +0x13
github.com/withastro/compiler/internal.(*parser).parse(0x6d9440)
github.com/withastro/compiler/internal/parser.go:2995 +0x3
github.com/withastro/compiler/internal.ParseWithOptions({0x7b778, 0x42dac0}, {0x439b80, 0x1, 0x1})
github.com/withastro/compiler/internal/parser.go:3059 +0x1c
main.Transform.func1.1.1()
./astro-wasm.go:295 +0xc
created by main.Transform.func1.1
./astro-wasm.go:286 +0x14

Link to Minimal Reproducible Example

stackblitz not enabled.

@Princesseuh Princesseuh added the needs triage Issue needs to be triaged label Nov 12, 2023
@MoustaphaDev MoustaphaDev self-assigned this Nov 15, 2023
@MoustaphaDev MoustaphaDev added the - P3: minor bug An edge case that only affects very specific usage (priority) label Nov 15, 2023
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants