Use custom Layout, markdown in Content area not render in preview mode.
Kythuen opened this issue · comments
Kythuen commented
Describe the bug
- When there is development mode, everything is ok.
- In preview mode, when coming form a direct route link or refresh page, the markdown of the content do not render.
Reproduction
- come in page
/
- click button
to guide page
, then route to page/guide
, now is ok. - then refresh the page at
/guide
, the content area not render.
Expected behavior
As for a document website, we often hope others come in through a detail page url.
System Info
System:
OS: Windows 10 10.0.19045
CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
Memory: 14.93 GB / 31.72 GB
Binaries:
Node: 20.12.1 - ~\.nvmd\versions\20.12.1\node.EXE
npm: 10.5.0 - ~\.nvmd\versions\20.12.1\npm.CMD
pnpm: 8.15.6 - ~\.nvmd\versions\20.12.1\pnpm.CMD
Browsers:
Edge: Chromium (123.0.2420.97)
Internet Explorer: 11.0.19041.3636
Additional context
- Repo: https://github.com/Kythuen/vitepress-demo
- Onlie page : https://kythuen.github.io/vitepress-demo/
- Detail description see README.md in repo.
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Machineric commented
I'm facing this issue as well. Exactly the same situation.
Erdem ÜN commented
I am facing same error
Erdem ÜN commented
you can solve with nginx. but I think vitepress need to solve this error
nginx resolve
...
location / {
# for example.com/ so unpath requests
if ($http_:path: = "/") {
rewrite ^(.*)/$ $1 permanent;
}
try_files $uri $uri.html $uri/ =404;
error_page 404 /404.html;
error_page 403 /404.html;
}
Divyansh Singh commented
you're using ClientOnly and Suspense in your layout which will disable SSR for whole app. This is not supported. Use plain vite app if you don't want SSR.
Kythuen commented
you're using ClientOnly and Suspense in your layout which will disable SSR for whole app. This is not supported. Use plain vite app if you don't want SSR.
thank you, it worked.