Next.js Discord

Discord Forum

notFound()

Unanswered
Russian Spaniel posted this in #help-forum
Open in Discord
Russian SpanielOP
Sorry to be that guy I am sure this question has been asked, probably repeatedly, I noticed on every request notFound() gets invoked. Is there any way to tell when it's being invoked whether it's actually a 404 (or not) so i can submit an api call etc? Could this be done from the function (i checked the headerlist with no differences whether it's a valid page or a true 404). Middleware?

3 Replies

Russian SpanielOP
bump
Russian SpanielOP
bump
Yellowstripe scad
on every request notFound() gets invoked

what do you mean by this?