vite-pwa / vitepress

Zero-config PWA Plugin for VitePress
https://vite-pwa-org.netlify.app/frameworks/vitepress
MIT License
36 stars 2 forks source link

[BUG] "Hydration completed but contains mismatches" when path contains URL params #29

Open zyxkad opened 9 months ago

zyxkad commented 9 months ago

Describe the bug

When I add some url params such as ?a=1&b=2 after the page's URL, the console log an error Hydration completed but contains mismatches. and the page rendering is incorrect

Reproduction

  1. Clone from https://github.com/GlobeMC/crashmc.com
  2. pnpm install && pnpm run docs:build && pnpm run docs:preview
  3. Access http://localhost:4173/client/system.html and http://localhost:4173/client/system.html?someparam=somevalue
  4. The page without param will works well, but the page with the URL param will somehow mixed with the home page's content

OR

Just access https://vite-pwa-org.netlify.app/guide/register-service-worker.html?

Expected behavior

The two pages should looks exactly same.

Some information at https://github.com/vuejs/vitepress/issues/3469

userquin commented 9 months ago

I guess it is a bug in workbox, it is returning the fallback page content, if you just request this another page it is working properly https://vite-pwa-org.netlify.app/guide/register-service-worker.html?xxxx

EDIT: we've activated includeAllowlist here