vercel/next.js

next build isn't detecting generateStaticParams returning empty array in page.tsx

arnold-wds opened this issue · 0 comments

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/intelligent-lichterman-wjpvwn

To Reproduce

  1. Build the application.

Current vs. Expected behavior

According to the documentation, expected behavior is "To statically render all paths the first time they're visited, return an empty array (no paths will be rendered at build time)" and it should build and run

Current behavior: The build fails and isn't detecting the generateStaticParams solution.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:11 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6020
  Available memory (MB): 16384
  Available CPU cores: 12
Binaries:
  Node: 20.18.1
  npm: 10.8.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.1.2 // Latest available version is detected (15.1.2).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.2.0
  typescript: 5.6.3
Next.js Config:
  output: export

Which area(s) are affected? (Select all that apply)

Developer Experience, Output (export/standalone), Runtime, TypeScript, Webpack

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

If I made a generateStaticParams that didn't return an empty array, it seemed to work. However, that stops me from navigating to other, not-statically defined routes. I have a million different combinations these slugs can have, so I don't want to write them all and I want them to dynamically generate at runtime. The issue is that I need a static export for my AspNetCore middleware to properly serve the files. If anyone could help me, that would be great.