Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
arnold-wds opened this issue Dec 20, 2024 · 1 comment
Labels
bug Issue was opened via the bug report template. Developer Experience Issues related to Next.js logs, Error overlay, etc. Output (export/standalone) Related to the the output option in `next.config.js`. Runtime Related to Node.js or Edge Runtime with Next.js. TypeScript Related to types with Next.js. Webpack Related to Webpack with Next.js.

Comments

@arnold-wds
Copy link

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.

@arnold-wds arnold-wds added the bug Issue was opened via the bug report template. label Dec 20, 2024
@github-actions github-actions bot added Developer Experience Issues related to Next.js logs, Error overlay, etc. Output (export/standalone) Related to the the output option in `next.config.js`. Runtime Related to Node.js or Edge Runtime with Next.js. TypeScript Related to types with Next.js. Webpack Related to Webpack with Next.js. labels Dec 20, 2024
@icyJoseph
Copy link
Contributor

This is unfortunately a known issue with export mode, I am afraid.

I know there had been a fix related to empty generateStaticParams return, #73358, but I am not sure it is the same here.

There was even a PR to change the incorrect error message: #67947

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Developer Experience Issues related to Next.js logs, Error overlay, etc. Output (export/standalone) Related to the the output option in `next.config.js`. Runtime Related to Node.js or Edge Runtime with Next.js. TypeScript Related to types with Next.js. Webpack Related to Webpack with Next.js.
Projects
None yet
Development

No branches or pull requests

2 participants