Skip to content

**Next.js error page (404, 400, 500) reload infinitely in development** #40000

Discussion options

You must be logged in to vote

I tried to control this with onDemandEntries on the next configuration file, but it didn't work, so I went to the source code, and this bit:

            // don't attempt fetching the page if we're already showing
            // the dev overlay as this can cause the error to be triggered
            // repeatedly
            if (payload.event === 'pong' && payload.invalid && !self.__NEXT_DATA__.err) {
                // Payload can be invalid even if the page does exist.
                // So, we check if it can be created.
                fetch(location.href, {
                    credentials: 'same-origin'
                }).then((pageRes)=>{
                    if (pageRes.status === 200) 

Replies: 17 comments 28 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Senbonzakura1234
Comment options

You must be logged in to vote
2 replies
@mrpitch
Comment options

@michaelhpet
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@NK3678
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ThiagoPedais
Comment options

Comment options

You must be logged in to vote
13 replies
@chebread
Comment options

@petrosmm
Comment options

@p00000001
Comment options

@petrosmm
Comment options

@zineanteoh
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@kdb13
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@kdb13
Comment options

@ztanner
Comment options

Comment options

You must be logged in to vote
3 replies
@timneutkens
Comment options

@JurajKavka
Comment options

@Jordaneisenburger
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@gayancharith
Comment options

@OmarAfet
Comment options

@ketijakrista
Comment options

@OmarAfet
Comment options

@ragnarok22
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet