-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers
Milestone
Description
Bug report
Describe the bug
When using a custom _error page, Next can enter an infinite loop if _error render throws on client side (with a production build).
To Reproduce
Repro here : https://github.com/dorian-marchal/next-repro/tree/repro-6973
In a terminal:
$ git clone -b repro-6973 https://github.com/dorian-marchal/next-repro
Cloning into 'next-repro'...
$ cd next-repro/
$ node -v
v10.14.1
$ npm install
$ npm ls next
next-repro@1.0.0 /tmp/next-repro
└── next@8.0.4
$ npm run build && npm run start
...
> Ready on http://localhost:3000
In your browser:
- Go to http://localhost:3000/
- Open your browser devtools
- Click on "Client side nav"
- See the app entering an endless loop (stopped after 20 iterations).
Expected behavior
On client side, if _error throws, I expect an "Internal Error" page (this is what happens when _error throw during server side rendering).
I suppose that Next could force a page reload in this case.
System information
- OS: Ubuntu 18.04
- Version of Next.js: 8.0.4
Additional context
In our project, this error happens when _error getInitialProps fails to retrieve some dependencies (Error.render tries to access an undefined property).
adrienWeiss, demariadaniel, sanghin, MarcusBondezan, egemon and 11 more
Metadata
Metadata
Assignees
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers