#Question on Static Site Generation -- How to get relatively pure HTML, and not a bunch of .js files?

1 messages · Page 1 of 1 (latest)

plain turtle
#

Question on Static Site Generation during build && export:

I can't seem to get basic HTML output in my outputted html files (i.e., with things like the <h1><h2> tags as specified in my source .tsx files...

, I can only get .html files in my "out" folder that tend to include a lot of .js chunk files and some css and a big JSON payload for the client to hydrate. Am I missing a setting when running npm run build?

#

Hi all -- I've been pulling my hair out on this one. I have "npm run build" set to do a next build && next export.

#

For even the simplest static files, like say an About page, it renders .html files that look like this:

#

This is my second Next.js project, and in my first one (using v. 11), a simple next build && next export rendered the expected much purer HTML, including all the <h1>, <h2> etc. tags. What am I doing wrong here?

#

This happens in my project whether I use next 12.x or 11.x

#

BUT the really odd thing is that on my same machine, I have another project which properly renders .html files without all the JSON payload stuff in them, and which DO include the <h1>... tags in the html. For the life of me I can't see the difference between the methodology I'm using.

plain turtle
#

AHA! I figured it out

#

So it was of course a coding error on my side. I had a block of code in the _app.tsx page which would not render the children if a user wasn't authenticated