My vite+vike project is not prerendering at all #1864
Replies: 2 comments 8 replies
-
I suspect a user-land issue, but minimal reproduction welcome if you believe otherwise. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/AoSankaku/vite-vike-i18n-test dist/client/index.html<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/assets/static/renderer_Layout-031b266d.Cqz1SQAi.css">
<meta charset="UTF-8" />
</head>
<body>
<div id="page-view"><div style="display:flex;max-width:900px;margin:auto"><div style="padding:20px;padding-top:42px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;line-height:1.8em"><a href="/" class="navitem">Home</a><a href="/about" class="navitem">About</a><a href="/movies" class="navitem">Movies</a></div><div style="padding:20px;padding-bottom:50px;border-left:2px solid #eee;min-height:100vh"><h1>Welcome</h1>This page is<!-- -->:<ul><li>Localized<!-- -->. <!-- -->Change language<!-- -->:<!-- --> <a href="/" style="margin-left:7px">en-US</a><a href="/de-DE/" style="margin-left:7px">de-DE</a><a href="/fr-FR/" style="margin-left:7px">fr-FR</a></li><li>Rendered to HTML</li><li>Interactive<!-- --> <button type="button">Counter<!-- --> <!-- -->0</button></li></ul></div></div></div>
<script id="vike_pageContext" type="application/json">{"pageProps":"!undefined","locale":"en-US","abortReason":"!undefined","_urlRewrite":null,"_urlRedirect":"!undefined","abortStatusCode":"!undefined","_abortCall":"!undefined","_pageContextInitIsPassedToClient":"!undefined","_pageId":"/pages/index","routeParams":{},"data":"!undefined"}</script>
<script src="/assets/entries/entry-client-routing.Ckb3HvbX.js" type="module" async></script>
<link rel="modulepreload" href="/assets/entries/pages_index.yzWykeJh.js" as="script" type="text/javascript">
<link rel="modulepreload" href="/assets/chunks/chunk-ClEYa4BI.js" as="script" type="text/javascript">
<link rel="modulepreload" href="/assets/chunks/chunk-Bh9oUNAu.js" as="script" type="text/javascript">
</body>
</html> The indispensable part is pre-rendering head part as social medias like twitter won't recognize any html codee generated by JavaScript. I figured it out "pre-rendering" or "SSG" on vike is much different than I supposed. Though it is a tough decision, I'll quit using vite and vike and migrate to next.js. Thank you for your quick responce anyway! |
Beta Was this translation helpful? Give feedback.
-
My vite project with vike is not prerendering at all!!! (Produces html file without prerendered).
Due to this issue, I can't investivate the expected behavior (example built file) myself.
My repository (language-rework branch)
https://github.com/AoSankaku/station_sign_generator/tree/language-rework
My goals are:
built html file in dist/client
vite.config.ts
+Pages.tsx
Beta Was this translation helpful? Give feedback.
All reactions