Skip to content

[BUG] export const dynamicParams = false; in on route breaks all dynamic features and rewrites in unrelated routes #611

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

Open
lauri865 opened this issue Apr 29, 2025 · 1 comment
Labels
bug Something isn't working triage

Comments

@lauri865
Copy link

lauri865 commented Apr 29, 2025

Describe the bug

A weird issue we hit when migrating from next-on-pages. A bunch of features and dynamic pages didn't work. By removing routes one by one, we found that the culprit was a completely unrelated splat route that exported dynamicParams = false, which broke rewrites, other dynamic routes (e.g. robots.txt), etc. For some reason an unrelat

Repro: https://github.com/lauri865/opennext-routes-repro

Steps to reproduce

run: pnpm preview
navigate to: http://localhost:8787/robots.txt
witness a 404 page

remove export const dynamicParams = false;
from app/[slug]/page.tsx
and robots.txt works again

Expected behavior

export const dynamicParams = false; should not affect / break unrelated routes.

@opennextjs/cloudflare version

1.0.0-beta.4

Wrangler version

4.13.2

next info output

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 20.11.0
  npm: 10.2.4
  Yarn: N/A
  pnpm: 10.7.1
Relevant Packages:
  next: 15.3.1 // Latest available version is detected (15.3.1).
  eslint-config-next: 15.3.1
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A

Additional context

No response

@lauri865 lauri865 added bug Something isn't working triage labels Apr 29, 2025
@lauri865 lauri865 changed the title [BUG] export const dynamicParams = false; breaks all dynamic features and rewrites in unrelated routes [BUG] export const dynamicParams = false; in on route breaks all dynamic features and rewrites in unrelated routes Apr 29, 2025
@conico974
Copy link
Collaborator

Corresponding issue in aws : opennextjs/opennextjs-aws#677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants