Closed
Description
Run next info
(available from version 12.0.8 and up)
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101
Binaries:
Node: 16.13.1
npm: 8.3.0
Yarn: 1.22.17
pnpm: 6.11.0
Relevant packages:
next: 12.0.8-canary.17
react: 17.0.2
react-dom: 17.0.2
What version of Next.js are you using?
12.0.7 and 12.0.8-canary.17 both reproduce
What version of Node.js are you using?
16.13.1
What browser are you using?
Chrome and Safari both reproduce
What operating system are you using?
macOS 12.1 (21C52)
How are you deploying your application?
Vercel, next dev
and next start
all reproduce
Describe the Bug
When a rewrites
function is specified in next.config.js
, every page renders twice in the browser, regardless of the nature of this function.
Expected Behavior
Specifying a rewrites
function does not cause double renders.
To Reproduce
- Clone
https://github.com/valerie-makes/nextjs-rewrites-bug
- Install dependencies:
npm install
- Build and start the app:
npm run build && npm start
- Visit the index page and observe the browser console:
rendering Home rendering Home
- Comment out the
rewrites
function innext.config.js
- Repeat Step 3 and Step 4:
rendering Home
Metadata
Metadata
Assignees
Labels
No labels