How to generate full static HTML site? No next.js javascript in it. just pure HTML thing #15996
Replies: 2 comments 1 reply
-
I don't have experience with this use case, but from the little I know it seems that You are mentioning issues with incomplete rendering of particular components when the runtime scripts are not present. Perhaps if you reproduced the issue in some minimal example others may be able to help? You can, for example, swap CMS for static values or static JSON files. |
Beta Was this translation helpful? Give feedback.
-
next-client-script is a project that is working towards this goal. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have general page [...slug].js with idea to grab slug from router and then build the content. I just get the content from backend by slug. Slug may be
cat-1/cat-1.1/article
or justarticle
.so inside
[...slug].js
i havegetStaticPaths
which fetches the article data and renders it.exportPathMap
insidenext.config.js
and i started to get the article rendered as it should yet then menu was not rendering after navigating into one of the articles and refreshing the page. Menu was still rendering with JS requirement.in some git issues, I read that exportPathMap is depreciated. Yet not sure how to render the static HTML.
I tried adding this code to
[...slug].js
but then i again had partial render. All dynamic content coming from backend was not rendered into HTML.also tried
getStaticPaths
inside[...slug].js
withfallback: false
Is there any guide where it would say how to render a full static HTML page w/o any JS in the deployed production site?
I guess i used all good things for the job but in some wrong combination
Beta Was this translation helpful? Give feedback.
All reactions