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

onRouteDidUpdate does not see new Head metadata #8278

Open
7 tasks done
slorber opened this issue Nov 2, 2022 · 0 comments
Open
7 tasks done

onRouteDidUpdate does not see new Head metadata #8278

slorber opened this issue Nov 2, 2022 · 0 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@slorber
Copy link
Collaborator

slorber commented Nov 2, 2022

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

When navigating between routes, the onRouteDidUpdate client module lifecycle does not see the newly updated Head / Helmet metadata

This leads to annoying usage of setTimeout in userland plugins.

As commented in #3399 (comment), I believe this is due to react-helmet-async using <Helmet defer={true}/> by default (to confirm).

We should study the impact of turning defer={false}: performance or anything else

Reproducible demo

No response

Steps to reproduce

Take a deploy preview, navigate to another page, and look at console logs.
https://deploy-preview-8275--docusaurus-2.netlify.app/

CleanShot 2022-11-02 at 12 41 44@2x

Expected behavior

title/description (and other metadata) should rather be correct

Actual behavior

title/description is incorrect

Your environment

No response

Self-service

  • I'd be willing to fix this bug myself.
@slorber slorber added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers and removed status: needs triage This issue has not been triaged by maintainers labels Nov 2, 2022
@Josh-Cena Josh-Cena changed the title onRouteDidUpdate does not seen new Head metadata onRouteDidUpdate does not see new Head metadata Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

1 participant