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: Commented out scripts can crash the compiler #988

Open
lilnasy opened this issue Mar 26, 2024 · 1 comment
Open

🐛 BUG: Commented out scripts can crash the compiler #988

lilnasy opened this issue Mar 26, 2024 · 1 comment
Labels
- P4: important Violate documented behavior or significantly improves performance (priority)

Comments

@lilnasy
Copy link
Contributor

lilnasy commented Mar 26, 2024

What version of @astrojs/compiler are you using?

2.7.0

What package manager are you using?

pnpm

What operating system are you using?

Windows

Describe the Bug

image
runtime error: slice bounds out of range [1:0]
---
import Grid from "../components/Grid"
---
<!-- <script>
import Grid from "../components/Grid"
</script> -->
<Grid client:only/>

Link to Minimal Reproducible Example

Live Astro Compiler

@github-actions github-actions bot added the needs triage Issue needs to be triaged label Mar 26, 2024
@MoustaphaDev MoustaphaDev added the - P2: has workaround Bug, but has workaround (priority) label Jan 20, 2025
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Jan 20, 2025
@MoustaphaDev
Copy link
Member

MoustaphaDev commented Jan 20, 2025

It's actually a combination between the import in the script, the frontmatter, and the component present in the template that causes the bug.

---
// removing this makes the issue go
import Grid from "../components/Grid"
---
<!-- or this -->
<Grid client:only="react"/>

<script>
<!-- or this -->
import Grid from "../components/Grid"
</script>

@MoustaphaDev MoustaphaDev added - P4: important Violate documented behavior or significantly improves performance (priority) and removed - P2: has workaround Bug, but has workaround (priority) labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

No branches or pull requests

3 participants
@lilnasy @MoustaphaDev and others