Skip to content

Wrong link showing up after building Docusaurus website #5617

Closed

Description

@kimlimjustin

🐛 Bug Report

Prerequisites

Description

The link of the a tag on the index.jsx file went wrong when building the docusaurus website but it's all okay when running the local development.

Have you read the Contributing Guidelines on issues?

yes

Steps to reproduce

I don't think I could host the production on code sandbox, could I? However, here's the code https://github.com/kimlimjustin/xplorer/blob/master/docs/src/pages/index.jsx

Expected behavior

I hope the link is just okay (same as when development).

(Write what you thought would happen.)

Actual behavior

The link is just broken.

Docusaurus.bug.mp4

Your environment

Reproducible demo

Here's the source code: https://github.com/kimlimjustin/xplorer/blob/master/docs/src/pages/index.jsx

Activity

  1. added
    bug
    status: needs triage
    on Sep 26, 2021
  2. kimlimjustin commented on Sep 26, 2021

    @kimlimjustin
    Author

    Btw, I tried replacing <a> tag with the Link tag but still the same problems. Here's the code
    image

  3. Josh-Cena commented on Sep 26, 2021

    @Josh-Cena
    Collaborator

    Try running yarn clear? Also your site builds super fast👀

  4. kimlimjustin commented on Sep 26, 2021

    @kimlimjustin
    Author

    Try running yarn clear?

    Yep, also removed all node_modules and yarn.lock and reinstall. Same bug.

  5. kimlimjustin commented on Sep 26, 2021

    @kimlimjustin
    Author
    docusaurus.bug.1.mp4

    Here's the screen record.

  6. slorber commented on Sep 28, 2021

    @slorber
    Collaborator

    This is annoying, not the first time it happens, was also reported once by the React-Native website.

    This is likely a React hydration problem: https://www.joshwcomeau.com/react/the-perils-of-rehydration/

    This may be a bug in the Docusaurus theme (considering you don't have much customizations), but it could as well be a React bug 😅

    Can you reproduce this bug in a newly initialized Docusaurus site with the same config?

    Often, adding extra paragraphs and divs around the problematic elements is a good-enough workaround.

  7. kimlimjustin commented on Sep 28, 2021

    @kimlimjustin
    Author

    Can you reproduce this bug in a newly initialized Docusaurus site with the same config?

    Yes if I copy the whole document of index.jsx.

    Often, adding extra paragraphs and divs around the problematic elements is a good-enough workaround.

    It works, but it's just annoying since the link is on a paragraph and I have to fight against the CSS.

  8. linked a pull request that will close this issuefix: text/link hydration bug #5629on Sep 30, 2021
  9. slorber commented on Sep 30, 2021

    @slorber
    Collaborator

    Finally I was able to find the cause, happy to get this solved!

    #5629

  10. removed
    status: needs triage
    on Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions