malcolmstill / astro-lit-hydration-issue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

# Astro + Lit SSR hydration issue

Screenshot 2023-11-01 at 12 19 37

Component B (child of component A) fails to hydrate when using SSR.

In component C and D I instead define constructors to set the properties hydration seems to work but then items in component D is at some point undefined and an error is thrown.

  • Is this a bug / issue?
  • Am I holding astro, lit or astro + lit wrong?

## Details

This is a minimal reproduction built by:

  1. Create astro project
npm create astro@latest

(empty project using typescript)

  1. Add lit
npx astro add lit
  1. Update tsconfig

Add options experimentalDecorators true and useDefineForClassFields false:

{
  "extends": "astro/tsconfigs/strict",
  "compilerOptions": {
    "experimentalDecorators": true,
    "useDefineForClassFields": false
  }
}

  1. Add components (see index.astro + src/components/)

About


Languages

Language:TypeScript 50.5%Language:Astro 44.1%Language:JavaScript 5.4%