You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because, the docs says that this line will return an empty array: console.log(invoice); // Invoice is an empty array []
But when the UUID doesn't exist, it throws an errors instead an empty array.
I've downloaded the template the last week so everything should be updated.
I logged on console just before notFound() in invoices/[id]/edit/page.tsx and it logged an empty array and the 404 error page rendered as it supposed to be.
if (!invoice) {
console.log('error');
notFound();
}
I am not sure how it worked but it did for me.
PS you can remove the console log afterwards and the page stays there.
After complete the part of Handling all errors with error.tsx, if you follow the instructions of Handling 404 errors with the notFound function, you won't get any 404 page.
This is because, the docs says that this line will return an empty array:
console.log(invoice); // Invoice is an empty array []
But when the UUID doesn't exist, it throws an errors instead an empty array.
I've downloaded the template the last week so everything should be updated.
Link
https://nextjs.org/learn/dashboard-app/error-handling
The text was updated successfully, but these errors were encountered: