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

Preact children props breaks rendering #10191

Closed
1 task
zappys opened this issue Feb 22, 2024 · 1 comment · Fixed by #10200
Closed
1 task

Preact children props breaks rendering #10191

zappys opened this issue Feb 22, 2024 · 1 comment · Fixed by #10200
Assignees
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)

Comments

@zappys
Copy link

zappys commented Feb 22, 2024

Astro Info

Astro                    v4.4.2
Node                     v18.18.0
System                   Linux (x64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/preact

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Rendering breaks when embeding preact component in astro component but only when sending children props to the preact component

Repo replicating the bug: https://github.com/zappys/withastro-astro-zd2fmf/blob/main/src/pages/index.astro
Stackblitz replicating the error: https://stackblitz.com/edit/withastro-astro-zd2fmf?file=src%2Fpages%2Findex.astro

Here is the stack trace:

TypeError: html.replace is not a function
    at removeStaticAstroSlot (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/component.js:54:15)
    at Object.render (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/component.js:249:15)
    at Module.renderChild (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/any.js:29:17)
    at async Object.renderToFinalDestination (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/util.js:115:7)
    at async RenderTemplateResult.render (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/astro/render-template.js:39:9)
    at async Module.renderChild (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/any.js:29:5)
    at async Object.render (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/slot.js:23:7)
    at async Module.renderChild (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/any.js:29:5)
    at async Object.renderToFinalDestination (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/util.js:115:7)
    at async RenderTemplateResult.render (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/astro/render-template.js:39:9)
    at async Module.renderChild (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/any.js:29:5)
    at async AstroComponentInstance.render (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/astro/instance.js:47:7)
    at async Object.render (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/component.js:343:7)
    at async Module.renderChild (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/any.js:29:5)
    at async Object.renderToFinalDestination (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/util.js:115:7)
    at async RenderTemplateResult.render (/Users/ba/Dev/withastro-astro-zd2fmf/node_modules/astro/dist/runtime/server/render/astro/render-template.js:39:9)

What's the expected result?

It should render the component without errors

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-zd2fmf?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Feb 22, 2024
@matthewp matthewp added - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) and removed needs triage Issue needs to be triaged labels Feb 22, 2024
@Princesseuh Princesseuh self-assigned this Feb 22, 2024
@Princesseuh
Copy link
Member

Princesseuh commented Feb 22, 2024

The issue seems to be that Preact is somehow returning an array of strings instead of a string for the HTML. I'm not sure why, however I couldn't reproduce this issue when using main's version of Astro and the Preact integration, which makes me think that maybe this has been fixed already? We'll release a patch shortly and see how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants