-
Notifications
You must be signed in to change notification settings - Fork 557
nextjs is not a static site generator #390
Comments
As per vercel/next.js#1972 this hasn't been a requirement anymore since Next.js 6+.
Next.js implements the process of pre-rendering. In case of |
As you can see the default behaviour works as expected with the latest version of Next.js:
|
Here's how to reproduce it:
My package.json:
|
As per what I said earlier:
So the example should just be upgraded to the latest version. |
@kasajian I use nextjs to build static websites and it works quite well. A couple of examples: Clone either of those, then
|
I'm creating a PR to fix the Next.js version 👌 |
I think this is really awesome that you were able to resolve the problem so quickly, but I'm sorry this is kinda too little too late. The "latest" is whatever is on the site. I went to the site and clicked on the "latest" button that said tutorial. I ran through the latest instructions and I got this defect. So as far as I am concerned, i wasn't not running an older version. I followed the latest instructions. Hopefully this can be corrected for the next person who is looking at NextJs as a static-site generation tool. It's a good tool, so I hope it works out for them. I'll be using something else, but will come back to NextJs when i want something more sophisticated, such as a starter-app for React |
One of the requirements of a static site generator is that it should generate a static site.
But when I use it, it uses nodejs locally as a server.
It has an "export" function, which supposedly can generate a static site, but it does not work.
You get an error:
Could not find "exportPathMap" function inside "next.config.js"
Looking through the documentation, it looks like you need to do more coding to get all that to work. It seems like static-site generation is an afterthought for nextjs and very poortly implemented, if anyone even gets it to work.
I suspect that's not the main Use Case anyway. Going through the tutorial and the overview, it hardly mentions that Use Case. It's deeper in the docs, and I honestly would have missed it entirely if it hadn't been for the fact that the StaticGen site pointed me to it.
My recommendation is to remove it from your list until such time they decide to support it in earnest. Other than that, nextjs looks like a great tool that I would probably use in the future, and recommend to others -- but not for static site generation.
The text was updated successfully, but these errors were encountered: