vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.17k stars 2.12k forks source link

testing environment refresh page error. example: framework.gVONBIN7.js:13 Hydration completed but contains mismatches. #4167

Open thompsonjiang opened 2 months ago

thompsonjiang commented 2 months ago

Describe the bug

image

Reproduction

测试环境刷新页面即可复现,本地运行正常 image image

Expected behavior

find the reason and fix it

System Info

window chrome virepress v1.3.2  node.js v16.18.0

Additional context

No response

Validations

brc-dd commented 2 months ago

Cannot find the reason without looking at your code. Please provide a minimal reproducible example. Some component of yours might not be SSR compatible. You will need to either make it SSR compatible or wrap it with <ClientOnly>. https://vitepress.dev/guide/ssr-compat

You can get more helpful warnings by specifying export DEBUG=true (set DEBUG=true in Windows cmd) and then building your vitepress app and previewing it.

thompsonjiang commented 2 months ago

You can get more helpful warnings by specifying export DEBUG=true (set DEBUG=true in Windows cmd) and then building your vitepress app and previewing it.

image image image image Only one global component .I can't find reson.

brc-dd commented 2 months ago

You can get more helpful warnings

I meant in browser console. Not your terminal.

Is your repo public?

Only one global component

Does it work if you remove it? (both from theme and markdown)?

thompsonjiang commented 2 months ago

You can get more helpful warnings

I meant in browser console. Not your terminal.

Is your repo public?

Only one global component

Does it work if you remove it? (both from theme and markdown)?

Not about the component. This is a simple demo.

vitepress-demo.zip

thompsonjiang commented 2 months ago

You can get more helpful warnings

I meant in browser console. Not your terminal.

Is your repo public?

Only one global component

Does it work if you remove it? (both from theme and markdown)?

I have discovered the reason. Remove "cleanUrls". image