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: @astrojs/compiler panic #553

Closed
1 task
garfieldnate opened this issue Jul 21, 2022 · 4 comments
Closed
1 task

🐛 BUG: @astrojs/compiler panic #553

garfieldnate opened this issue Jul 21, 2022 · 4 comments
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@garfieldnate
Copy link

What version of astro are you using?

1.0.0-beta.73

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

yarn

What operating system are you using?

Mac

Describe the Bug

@astrojs/compiler encountered an unrecoverable error when compiling the following file.

src/layouts/Home.astro

---
import Basic from "./Basic.astro";
import BaseHead from "../components/BaseHead.astro";
import Header from "../components/Header.astro";

import config from "../config.json";

let { title, description } = config;
---

<Basic content={{title, description}}/>

<html>

<head>
    <BaseHead title={title} description={description} />
</head>

    <body>
        <Header />
        <div class="wrapper">
            <main class="content">
                <section class="intro">
                    <h1>{title}</h1>
                    <p>{description}</p>
                </section>
                <section>
                    <slot/>
                </section>
            </main>
        </div>
    </body>

</html>

<style>
    .content {
        margin-bottom: 8rem;
        margin-top: 4rem;
    }

    .content :global(h2) {
        margin-top: 4rem;
    }

    .intro {
        padding-bottom: 4rem;
        margin-bottom: 2rem;
        border-bottom: 4px solid var(--theme-divider);
    }

    h1 {
        font-size: 2.5rem;
        font-weight: 700;
    }
</style>

Link to Minimal Reproducible Example

none

Participation

  • I am willing to submit a pull request for this issue.
@natemoo-re natemoo-re self-assigned this Jul 22, 2022
@natemoo-re natemoo-re added s1-small - P4: important Violate documented behavior or significantly improves performance (priority) labels Jul 22, 2022
@natemoo-re
Copy link
Member

Thanks for opening an issue! I think the problem might be the <Basic content={{title, description}}/> above the html? I'll definitely take a look at how we can fix this, though!

@garfieldnate
Copy link
Author

This panic occurred while I was still working on the component, and my final version was this (stupidly-simple) component:

---
import Base from "./Base.astro";
import config from "../config.json";

let { title, description } = config;
---

<Base content={{title, description}}>
    <slot/>
</Base>

This component works fine for me, so I don't think the issue was with the {title, description} syntax.

@natemoo-re natemoo-re added - P3: minor bug An edge case that only affects very specific usage (priority) and removed - P4: important Violate documented behavior or significantly improves performance (priority) labels Aug 1, 2022
@matthewp matthewp transferred this issue from withastro/astro Oct 7, 2022
@Princesseuh
Copy link
Member

I cannot seem to reproduce this using the latest version of Astro. Please re-open an issue if this still happen in those conditions.

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

No branches or pull requests

4 participants