Next.js Discord

Discord Forum

`next build` not running SSG, only `static`

Unanswered
Nile tilapia posted this in #help-forum
Open in Discord
Avatar
Nile tilapiaOP
Hello! I'm trying to use SSG to build a static site, but it only generates the static portion of the build in the .next directory, and not the SSG portion in the out directory. I've checked [the list of unsupported features](https://nextjs.org/docs/14/app/building-your-application/deploying/static-exports#unsupported-features), and am not using any of them. I've also added output: "export" and disabled image optimization in next.conf.mjs, and made sure to export the nextConfig as well. When I run next build I get the output below. If anyone has ideas on what could be preventing the SSG portion of the build from running, I'd definitely appreciate the help!

next build
  ▲ Next.js 14.2.16

   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Linting and checking validity of types    
 ✓ Collecting page data    
 ✓ Generating static pages (6/6)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

Route (app)                              Size     First Load JS
┌ ○ /                                    545 B          94.5 kB
├ ○ /_not-found                          875 B            88 kB
└ ○ /people/overview                     137 B          87.3 kB
+ First Load JS shared by all            87.1 kB
  ├ chunks/117-d8f8748ed26ceaca.js       31.6 kB
  ├ chunks/fd9d1056-aa94ea5c2eabf904.js  53.7 kB
  └ other shared chunks (total)          1.88 kB


○  (Static)  prerendered as static content

7 Replies

Avatar
um so the way i understand it, the build passes but it's not generating the output folder for you? can you send me the repository link if able?
Avatar
Nile tilapiaOP
That's correct. It's a private repo though, so I can't share it sadly. But if there's anything you can think of that I should look for, I can check that.
Avatar
a minimal reproduction repo will do
Avatar
Nile tilapiaOP
I think I've gotten it down to a minimum that still matches the real repo close-enough at https://github.com/tkyanko/test-app It's a Tauri app, using Nextjs as the frontend framework, though that seems like it shouldn't be the issue here. I also used the Tauri docs to set the Nextjs config, which just seems to be pretty standard for SSG.
Avatar
the file is called next.config.mjs not next.conf.mjs.
Avatar
Nile tilapiaOP
Ah, no idea how I missed that. Thanks! I just pushed a commit with that fixed, though it still seems to have the same issue as before.
Avatar
Nile tilapiaOP
Oh, it does work now, I just missed seeing the out directory and paid attention the log output from next build. Thanks for the help!