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

Direct link to page showing duplicated sections in the content #201

Closed
patak-dev opened this issue Jan 5, 2021 · 10 comments
Closed

Direct link to page showing duplicated sections in the content #201

patak-dev opened this issue Jan 5, 2021 · 10 comments
Labels
bug Something isn't working
Milestone

Comments

@patak-dev
Copy link
Member

Starting from https://vitepress.vuejs.org, you can navigate to the Markdown Extensions section and it properly works:

image

But reloading the page, or directly visiting https://vitepress.vuejs.org/guide/markdown.html is showing duplicated content:

image

@patak-dev patak-dev added the bug: pending triage Maybe a bug, waiting for confirmation label Jan 5, 2021
@kiaking
Copy link
Member

kiaking commented Feb 5, 2021

Oh yeah... hmmm... we must look into this. We're getting Hydration completed but contains mismatches. error in the console. I can only find this error in https://vitepress.vuejs.org/guide/markdown.html so markdown example should be the one causing it...? Need to to investigation.

@kiaking kiaking added bug Something isn't working and removed bug: pending triage Maybe a bug, waiting for confirmation labels Feb 5, 2021
@sampullman
Copy link
Contributor

I'm not sure if it's the exact same problem, but I get weird issues using [[toc]] where some sections are moved around or removed entirely. Similarly, it only happens when I refresh or visit directly, and only in the final build (not when served from vitepress dev docs

@sampullman
Copy link
Contributor

You can see this behavior in the Vitepress docs as well: https://vitepress.vuejs.org/guide/markdown.html#table-of-contents

When that page is loaded directly you get the "hydration mismatch" error (and the TOC is missing), but loading another page and navigating to the markdown section works fine.

@stefandesu
Copy link

stefandesu commented Jul 1, 2021

I have this problem as well. All pages that contain JavaScript show "Hydration completed but contains mismatches." when loaded directly. For example: https://gbv.github.io/jskos-vue/dev/components/ItemDetails.html

Interestingly, it works when navigating to the page from another site, but not if I simply go back and forth. Only the page that got initially loaded stays broken.

Even more interestingly: The JavaScript part of the page loads, but not the Markdown! Something is very weird here.

Edit: While there's definitely something weird going on here, I was able to fix my issue by putting some code into the onMounted hook. It seems like one of our dependencies is not exported correctly or something and it throws an error during the build. For some reason, it still works if you navigate there from another page, but doesn't if you load the page directly. This whole issue seems to be related to dependencies in some form.

@jw-foss
Copy link

jw-foss commented Aug 31, 2021

@patak-js Any idea what causes this? Having the same issue of duplicated sections and component lost.

@seonglae
Copy link

seonglae commented Sep 9, 2021

Hydration completed but contains mismatches. error occurs when I deployed vitepress to vercel with custom dns

@blurgyy
Copy link

blurgyy commented Sep 16, 2021

Building with mpa mode (e.g. yarn vitepress build --mpa) seems to solve this issue, as well as mentioned in #388

@seonglae
Copy link

seonglae commented Sep 16, 2021

In my case, mpa mode not working

@vmihailenco
Copy link

--mpa helps but it breaks client code that uses JS...

@kiaking
Copy link
Member

kiaking commented May 26, 2022

Can anyone try to reproduce this issue with the latest next-theme branch? It should be fixed by #660 but not 100% sure.

@kiaking kiaking added this to the v1.0.0 milestone May 27, 2022
@brc-dd brc-dd closed this as completed Jun 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants