Skip to content

Bug: Apps under rewrites() rules are reloaded indefinitely at the development side only. #59161

@9vfQbg7z4ajrGQxR

Description

@9vfQbg7z4ajrGQxR

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #99~20.04.1-Ubuntu SMP Thu Nov 2 15:16:47 UTC 2023
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: 1.22.18
  pnpm: 8.6.7
Relevant Packages:
  next: 14.0.3
  eslint-config-next: 13.0.7
  react: 0.0.0-experimental-ee8509801-20230117
  react-dom: 0.0.0-experimental-ee8509801-20230117
  typescript: 4.9.4
Next.js Config:
  output: N/A

Which example does this report relate to?

https://github.com/vercel/next.js/tree/canary/examples/with-zones

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

When using Multi-zone example, the app under rewrites() rules are reload indefinitely only at development side.
Terminal prints (at each auto refreshes):
⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload

PS: I know this issue is a duplicate of #54454 (comment), but this is becoming a matter of urgency, as we can no longer update Next beyond version 13.4.6 because it's impossible for us to develop. (and some many security updates related to nextjs packages are really high)

Expected Behavior

Shouldn't reload applications behind rewrites() rules in a loop.

To Reproduce

Start both or checkout https://github.com/vercel/next.js/tree/canary/examples/with-zones:
https://codesandbox.io/p/sandbox/multi-zones-1-m79cw8?file=%2F.env%3A2%2C1
https://codesandbox.io/p/sandbox/multi-zones-2-xfk4d9?file=%2Fmiddleware.js%3A11%2C2

And click on "Zone 2" inside the navbar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    examplesIssue was opened via the examples template.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions