-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Description
Link to the code that reproduces this issue
https://github.com/PacoSoftwerft/multi-zone-microfrontends
To Reproduce
Start main-site
cd main-site
npm run dev
Start blog
Start the blog in a new shell
cd blog
npm run dev
Bug
Open http://localhost:3000/blog
, it is loading in a loop.
Current vs. Expected behavior
Expected behavior:
rewrite to same domain "localhost" with different port should work like they did in 13.4.12
Version [email protected]
is working just fine.
Stop the main-site
then
cd main-site
npm i [email protected] --save-exact
npm run dev
open http://localhost:3000/blog
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
Node: v18.18.0
npm: 10.1.0
Which area(s) are affected? (Select all that apply)
Routing (next/router, next/navigation, next/link)
Additional context
This bug was introduced with 13.4.13
The bug only appears when using the Pages Router
The bug depends on the version of the app that rewrites, here main-site.
It seems like the port is stripped/not respected somewhere.
The rewrite works if it points to another domain.
Additional info 2023-10-20
The bug only appears when both zones are started with npm run dev
main (3000) | blog (3001) | works? |
---|---|---|
npm run dev |
npm run dev |
❌ |
npm run dev |
npm run build npm run start |
✅ |
npm run build npm run start |
npm run dev |
✅ |
npm run build npm run start |
npm run build npm run start |
✅ |