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

generateStaticParams issue with output: "export" in config during development #64906

Open
hsucherng opened this issue Apr 23, 2024 · 1 comment · May be fixed by #65348
Open

generateStaticParams issue with output: "export" in config during development #64906

hsucherng opened this issue Apr 23, 2024 · 1 comment · May be fixed by #65348
Labels
bug Issue was opened via the bug report template. Output (export/standalone) Related to the the output option in `next.config.js`.

Comments

@hsucherng
Copy link

Link to the code that reproduces this issue

https://github.com/hsucherng/nextjs-genstaticparams-output-export-issue

To Reproduce

  1. Run npm run dev.

Current vs. Expected behavior

Current behaviour: When I try to view http://localhost:3000/en, an error occurs: Error: Page "/[lang]/page" is missing exported function "generateStaticParams()", which is required with "output: export" config.

Expected behaviour: I should be able to view http://localhost:3000/en without any errors.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32503
  Available CPU cores: 8
Binaries:
  Node: 18.18.0
  npm: N/A
  Yarn: N/A
  pnpm: n?A
Relevant Packages:
  next: 14.3.0-canary.18 // Latest available version is detected (14.3.0-canary.18).
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: export

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

Output (export/standalone)

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

next dev (local)

Additional context

I've tried with 14.1.3 and 14.2.2. The issue happens on both versions.

npm run dev works fine until output: "export" is added into the Next config.

A side note that npm run build works as intended. It is npm run dev that does not work as expected.

@hsucherng hsucherng added the bug Issue was opened via the bug report template. label Apr 23, 2024
@github-actions github-actions bot added the Output (export/standalone) Related to the the output option in `next.config.js`. label Apr 23, 2024
@MohamedKarrab
Copy link

Same error here, I can't use dynamic routes

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. Output (export/standalone) Related to the the output option in `next.config.js`.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants