Skip to content

Commit

Permalink
Throw an error inside an imported astro component so there is an erro…
Browse files Browse the repository at this point in the history
…r mid stream
  • Loading branch information
imattacus committed Oct 29, 2024
1 parent 0cfc69d commit 6ed8907
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/ssr/src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { getCart } from '../api';
const cart = await getCart(Astro.request);
const cartCount = cart.items.reduce((sum, item) => sum + item.count, 0);
function* generator() {
yield 1;
throw new Error('oops');
}
---

<style>
Expand Down Expand Up @@ -44,6 +49,7 @@ const cartCount = cart.items.reduce((sum, item) => sum + item.count, 0);
<a href="/login">
<span class="material-icons"> login</span>
</a>
{generator()}
<Cart client:idle count={cartCount} />
</div>
</header>

0 comments on commit 6ed8907

Please sign in to comment.