Skip to content

Commit 69fa22b

Browse files
committed
Bug: Fix issue with hydration failing in newer versions of Astro
1 parent 3857303 commit 69fa22b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ export default function (): AstroIntegration {
3636
'head-inline',
3737
readFileSync(new URL('../client-shim.min.js', import.meta.url), { encoding: 'utf-8' })
3838
);
39-
// Inject the hydration code, before a component is hydrated.
40-
injectScript('before-hydration', `import '@semantic-ui/astro-lit/hydration-support.js';`);
39+
// Inject the hydration support, using 'page' instead of 'before-hydration'
40+
// to work around Astro 6 not emitting before-hydration chunks for the client build
41+
injectScript('page', `import '@semantic-ui/astro-lit/hydration-support.js';`);
4142
// Add the lit renderer so that Astro can understand lit components.
4243
addRenderer({
4344
name: '@semantic-ui/astro-lit',

0 commit comments

Comments
 (0)