Closed HamHwong closed 1 year ago
I have the same problem
I also have the same problem.
I also have the same problem.
I also have the same problem.
通过修改 link
的值已解决
{ text: '指南', link: '/guide/' }
-> { text: '指南', link: '/guide/index.html' }
通过修改
link
的值已解决
{ text: '指南', link: '/guide/' }
->{ text: '指南', link: '/guide/index.html' }
Still not working for me...
Here is my updates:
I wrapped my doms which including my custom directives, built with some error,
so I have to go through the compling process and kept the directiveTransforms
in the config.js and list my custom directive names, like this:
And now it can be built fluently,
Then I started a web server from VS to check the generated dist files, and found no any error, soo suprise
Later after double check and tons of refreshing, I pushed them to server, expect some miracle.
Of course, still not working... TAT
But sudently, It came to me that my validation on local server was via IP, so I tried it, It shown correctlly, WTF?
I dont get it, soo weird...
It seems something related to my DNS provider (I'm using Cloudflare), After tried to change some settings, I found site works with my domain name only when I enabled 'dev mode' on CDN settings, which means request to the domain will not get any cache from CDN and directlly to my host,
oh, cache
I'm not sure, but I have a feeling, it seems related to CDN cache and bundled SSR, but I'm not soo familar with SSR ... Is that the SSR bundled in the vitepress building process?
What about runing a server?
So I changed my Nginx configration to redirect to 5000 port, run docs:serve with pm2.
Sadly, Still... I'm confused...
Until now, that's all my found.
Please provide a full reproduction with latest version of VitePress.
With 0.19.2 version I cannot reproduce it. I had the problem when updating some content pages on the vite-plugin-pwa docs page.
Please provide a full reproduction with latest version of VitePress.
I've updated to the latest version (0.20.0), but still got this error. you can see here mysite... and here's my repository
I have the same problem here: published docs (there is also a link to a github monorepo)
Also there are weird render artifacts:
Alongside from unexpected __VP_STATIC*
stuff note that originally markdown ends with Also section, but here you can see duplicated content rendering.
I think that https://github.com/vuejs/vitepress/issues/420 is a referenced issue here.
Can someone provide a "minimal" reproducible example for this with VitePress alpha??
@brc-dd I will provide today
Are you using Cloudflare's Auto Minify feature? You can try to turn it off to see.
@brc-dd WebSite where u can see the problem After reload cash. Github rep with "minimal" reproducible example. Just one index.md with text. Error in console: Hydration completed but contains mismatches.
Also! After off html (like say @kecrily ) - the web site work fine! How i undestand Cloudflare broke something after minimilize the html files...
Cloudflare's minimilize removes comments in html that make sense to vue.
Might need to add this to the documentation.
So this is an issue only with "auto minify" features of cloudflare, etc. right? Not with vitepress build && vitepress serve
?
Hmm, Yes..
This issue is actually mentioned here too: https://vite-plugin-ssr.com/hydration-mismatch#common-causes-solutions
Common causes:
- Rendered content is actually different. Make sure that your components render the same content in Node.js as well as in the browser.
- Browser cache: While developing, make sure to disable your browser's cache to ensure that your browser doesn't load cached & outdated JavaScript.
- Proxies: If you use a proxy, make sure it doesn't apply problematic HTML transfomers. For example, if you use Cloudflare, you have to disable Cloudflare's automatic HTML minifier.
Here is in-depth explanation: https://www.endpointdev.com/blog/2019/06/cloudflare-vue-ssr-significant-comments/
Here, the
<!----->
placeholder is a significant HTML comment, standing in for a non-visible component in the virtual DOM (the false condition in thev-if
directive). Rehydration requires this to be in place for proper handling, so when CF stripped out HTML comments from the returned page output this disrupted the generated server-side DOM. This meant that the server-side DOM no longer matched what Vue was expecting and the client-side hydration failed and the app failed to init properly.
I guess we should just add this to docs then as it cannot be fixed, at least for now. Adding a note here would be sufficient.
Describe the bug
I built and published vitepress pages to my server, but got
Hydration completed but contains mismatches
error when i review, and the index page rendered nothing but blank, and other pages show correctlly.But it runs perfectly on my local within dev mode
Reproduction
run npm docs:build
and wait.Expected behavior
the index page displays correctlly.
System Info
Additional context
I do get some warning when runing build process, my vue components library depends to PDF.js and some of my customized directives are using
document
for creting DOM, I'm not sure if it due to SSR of vitpress.And following are the configuration of my vitepress project.
docs/.vitepress/config.js
docs/.vitepress/theme/index.js
Validations