Skip to content

Helmet behaves strangely when rendering is asynchronous #117

@EmilTholin

Description

@EmilTholin

I was seeing some odd behavior with meta tags in the head of the static pages in my project. I created a new basic template, added a <Head><title> This is About </title></Head> to the About container, and <Head><title> This is Home </title></Head> to the Home container, and ran yarn build.

The About-title ended up in the index.html file and the Home-title was nowhere to be seen.

I looked into it a bit, and I think the async renderToString is the culprit. It works as intended if I just remove the await keyword.

It looks like Helmet doesn't work all that well if the rendering is asynchronous. I dare not create a PR making it synchronous, because I'm sure it has some other use case I'm not aware of.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions