next.js: [NEXT-659] Next.js 13 is broken for custom server with multiple zones
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Node 16.19.0
Yarn 3.1.4
Previously all worked on Next version 12.1.5
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://github.com/sirrodgepodge/busted-zones
To Reproduce
Following the instructions in the README, start by running
yarn && yarn dev
Mystery #1
First visit
http://localhost:3000/guest
See that ./hotel-guest/pages/_app.tsx
gets rendered (“Guest App” and the top left), but the component renders a 404, even though ./hotel-guest/pages/index.tsx
is defined.
Mystery #2
Even more perplexing… now visit
http://localhost:3000/host
See that ./hotel-host/pages/_app.tsx
gets rendered (“Host App” and the top left), but the component, instead of ./hotel-host/pages/index.tsx
renders the content of ./hotel-guest/pages/index.tsx
!!!
For mystery #1, I have no idea, for mystery #2, I can only conclude that there’s a global next.js pages cache of some sort (independent of next.js app instances).
Describe the Bug
I’ve upgraded to Next 13 and I’m seeing some insane behavior.
First there’s an issue with just rendering standard pages where it’s a 404.
Second, is as if there is a global next.js cache that is being referenced across multiple next app instances (I.e. “zones”) because when visiting the second app instance, the second _app.tsx
is rendered and the first index.tsx
is rendered.
Expected Behavior
These apps should render independently.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 18 (2 by maintainers)
@parvit thank you!! confirmed - bounty released 😃
@sirrodgepodge Yes i just updated the next version in all the package.json files and it worked.
@ijjk I’ve tested on my end from a fresh checkout and i can confirm that only updating the version to
v13.2.2-canary.4
fixes the issues.thank you @parvit - this looks great, it is still super unintuitive that one must change the app component names tbh, sounds like maybe that’s a webpack issue? But ofc it doesn’t affect a normal application with two components named the same.
regardless, thank you so much for figuring this one out, as soon as it’s merged into a non-canary version of Next.js will release the bounty
holy bejeesus, thank you, looking