Next.js Discord

Discord Forum

Next.js dashboard app tutorial Chapter 13 Handling Errors - problems!

Unanswered
Crème D’Argent posted this in #help-forum
Open in Discord
Avatar
Crème D’ArgentOP
Hello I am new in Next and React and in
tutorial Chapter 13 Handling Errors
https://nextjs.org/learn/dashboard-app/error-handling
and file
app\lib\actions.ts
at both functions updateInvoice, deleteInvoice there is problem with type,
they can return type '{ message: string; }' but expected type is 'void'
in
app\ui\invoices\edit-form.tsx ... <form action={updateInvoiceWithId}>
and in
app\ui\invoices\buttons.tsx ... <form action={deleteInvoiceWithId}>
so how to get rid of this error?

Somehow pnpm run dev can build this project (pnpm run build cannot)
but if an error occurs like bad SQL command
nothing (error.tsx UI boundary should?) will show the error message:
'Database Error: Failed to Update Invoice.'
or
'Database Error: Failed to Delete Invoice.'
so I have problem even understand this handling errors chapter.

This is basic tutorial am I missing something?

The code at github
https://github.com/vercel/next-learn/tree/main/dashboard/final-example
does not help either.

thanks

0 Replies