Static Site Generators (SSG) are frameworks that build websites from static content. For example, one can build an online blog from a list of text files.
Questions tagged [static-site-generation]
178 questions
14
votes
1 answer
Setup SSG and Prerender in SvelteKit
I just got started with SvelteKit and read the documentation. I would like to use SSG in my app and prerender every page. I configured my app as the documentation said but nothing seems to work as described.
What I want to achieve:
1. SSG…

Matyanson
- 301
- 2
- 8
11
votes
1 answer
How to add new pages without rebuilding an app with +150k static pages?
I have a MERN app in which I have integrated NextJS. First time with NextJS so bear with me. I have initially used SSR everywhere (getServerSideProps).
Key points:
I have over 150,000 pages with static content that it's never going to change.
Every…

barcel0
- 113
- 1
- 6
7
votes
1 answer
How to make NextAuth.js work with SSG (static site generated) in a Next.js website
Next.js allows you to build your site with either server-side (SSR) or static client-side (SSG) rendering, but when you run next build && next export it removes the /api routes.
Since NextAuth.js relies on these routes to for /api/auth/signin for…

Zaffer
- 1,290
- 13
- 32
6
votes
1 answer
Is it possible to utilize Incremental Static Regeneration on platforms other than Vercel?
I am using Next.js with Static Site Generation. I would like to add Incremental Static Regeneration to my application and host it on a cloud platform.
Is it possible to use ISR on other platforms than Vercel ( like Azure, AWS etc.)? I have been…

Lagrange4376
- 101
- 3
6
votes
3 answers
Pulumi (TypeScript, AWS): How to upload multiple files to S3 incl. nested files in directories for static website hosting
In the Create an AWS S3 Website in Under 5 Minutes YT video and Host a Static Website on Amazon S3 Pulumi tutorial there are great explanations how to create a website hosting on S3 using Pulumi.
In the example code Pulumi's Bucket and BucketObject…

jonashackt
- 12,022
- 5
- 67
- 124
6
votes
1 answer
The "notFound" prop of getStaticProps has no effect on page http status code
I just installed a new Next.js app. It has the following page:
// /pages/articles/[slug].js
import React from 'react'
import { useRouter } from 'next/router'
import ErrorPage from 'next/error'
const Article = (props) => {
const router =…

camcam
- 2,585
- 8
- 49
- 65
6
votes
0 answers
Gatsby build fails with error "HTMLElement is not defined"
I'm using Ionic React with Gatsby. When I try to gatsby build it fails with HTMLElement is not defined
It's compiling about the Ionic component which i'm not using (Please check error info below).
I cannot use setWebpackConfig to ignore the module…

sravis
- 3,562
- 6
- 36
- 73
5
votes
1 answer
Lektor CMS : Can't get lektor-tags to work properly, The requested URL was not found on the server
I am trying to build a blog using lektor CMS, for that.. i needed a tags system, after searching i found a lektor plugin on lektor docs called lektor-tags
I followed every step on the docs, struggled a lot and even visited the github repo to see if…

WaLid LamRaoui
- 2,305
- 2
- 15
- 33
5
votes
1 answer
Dynamic routing with next export mode
We're using Next.Js in next export mode (static HTML export), and we need advanced dynamic routing.
Our routes will look like /[config1]/[config2]/[optionalConfig?]/page, where one segment is optional and the page names are fixed. For example…

TrueWill
- 25,132
- 10
- 101
- 150
5
votes
2 answers
Next.js: getStaticPaths for nested dynamic routes
Imagine you have this data structure:
const data = {
posts: [{
id: 1,
title: "Post 1"
slug: "post-1"
}, {
id: 2,
title: "Post 2"
slug: "post-2"
}],
comments: [{
id: 1,
postId: "post-1",
text: "Comment 1…

Carlos Azaustre
- 395
- 2
- 6
- 15
4
votes
3 answers
Next.js how to ignore a complete folder in app?
On next 13, app/api folder creates an error during build when nextConfig.output is "export".
In my project, I need different build type depending on environnement variable.
Any way to ignore "api" folder during build when "output" is "export" ?
When…

ZecKa
- 2,552
- 2
- 21
- 39
4
votes
0 answers
Material-UI styles are not applied on first render when used with NextJS using emotion
I was following this github template: https://github.com/mui/material-ui/tree/master/examples/material-next
This is my website: https://ai-content-detector.online/
Its not able to load mui styles on first render. I have used emotion cache and…

Arsh Kashyap
- 41
- 1
4
votes
1 answer
Hosting Nextra (Next.js static site generator) website on GitHub Pages
Some days ago I came across Nextra, which is a static site generator based on Next.js.
The docs explain how to deploy a site to Vercel and I am wondering if I can deploy the site to GitHub Pages or any other platform that host static HTML…

Philipp
- 794
- 1
- 7
- 21
4
votes
0 answers
How to add global data to _app.tsx in Next.js without causing the whole app to be server-side-rendered (i.e: disabling Automatic Static Optimization)?
I'm building a Next.js app with React, Redux and Firebase.
My app's state is kind of split between two kinds. One is global (and should go into the Redux store), and the other is local for each specific page.
I'll be pre-rendering the pages (they…

cbdeveloper
- 27,898
- 37
- 155
- 336
4
votes
1 answer
How to generate static pages with nested dynamic routes
I have been working on this site and I have hit a wall. Basically I am supposed to list movies by genre, fetched from database. The genre should take me to another list based on the genre. Once a user clicks the movie from say 'action' genre it…

Taio
- 3,152
- 11
- 35
- 59