Next.js Discord

Discord Forum

Is SSG expected to create files in .next/server/app for /app/[locale]/[[...slug]]/page.tsx (v14.2)

Unanswered
African Slender-snouted Crocodil… posted this in #help-forum
Open in Discord
African Slender-snouted CrocodileOP
I would expect something to be generated, but it seems that even for a minimal example nothing is created without "force static":

export async function generateStaticParams() {
  return [
    { locale: 'de', slug: [] },
    { locale: 'de', slug: ['ueber-uns'] },
    { locale: 'de', slug: ['green-high-tech'] },
    { locale: 'en-de', slug: [] },
    { locale: 'en-de', slug: ['about-us'] },
  ];
}

export default async function Page({ params }) {
  return (
    <div>
      <h1>Test Page</h1>
      <p>Locale: {params.locale}</p>
      <p>Slug: {JSON.stringify(params.slug)}</p>
    </div>
  );
}

2 Replies

African Slender-snouted CrocodileOP
Folder output:
Build log output:

yarn run build && yarn run start
  ▲ Next.js 14.2.23
  - Environments: .env.local

   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Linting and checking validity of types    
 ✓ Collecting page data    
   Generating static pages (0/14)  [    ]
   Generating sitemap index...
   Sitemap index generated successfully
 ✓ Generating static pages (14/14)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

Route (app)                              Size     First Load JS
┌ ○ /_not-found                          877 B          88.3 kB
├ ● /[locale]/[[...slug]]                150 B          87.6 kB
├   ├ /de
├   ├ /de/ueber-uns
├   ├ /de/green-high-tech
├   └ [+2 more paths]
├ ƒ /[locale]/bestellung-abgeschlossen   1.82 kB         953 kB
├ ƒ /[locale]/blog                       150 B          87.6 kB
├ ƒ /[locale]/blog/[slug]                150 B          87.6 kB
├ ƒ /[locale]/changelog                  363 B           951 kB
├ ƒ /[locale]/checkout                   8.11 kB         146 kB
├ ● /[locale]/order-confirmation         1.82 kB         953 kB
├ ƒ /[locale]/preview/[slug]             363 B           951 kB
├ ○ /apple-icon.png                      0 B                0 B
├ ○ /sitemap.xml                         0 B                0 B
└ ƒ /sitemaps/[locale]                   0 B                0 B
+ First Load JS shared by all            87.5 kB
  ├ chunks/117-b02b9f3d3a7c1a53.js       31.8 kB
  ├ chunks/fd9d1056-37e449aaea1bb35b.js  53.6 kB
  └ other shared chunks (total)          2.06 kB


ƒ Middleware                             39.2 kB

○  (Static)   prerendered as static content
●  (SSG)      prerendered as static HTML (uses getStaticProps)
ƒ  (Dynamic)  server-rendered on demand