next-learn
next-learn copied to clipboard
Chapter 14 and ESLint Error defined but never used
- Running
pnpm lintdoes not output✔ No ESLint warnings or errorsbut it pointed out four files containing the error - This error will hinder the deployment to vercel and make the build fail, which is affecting the next chapter
> next lint
./app/lib/actions.ts
58:14 Error: 'error' is defined but never used. @typescript-eslint/no-unused-vars
93:14 Error: 'error' is defined but never used. @typescript-eslint/no-unused-vars
107:14 Error: 'error' is defined but never used. @typescript-eslint/no-unused-vars
./app/ui/customers/table.tsx
5:3 Error: 'CustomersTableType' is defined but never used. @typescript-eslint/no-unused-vars
./app/ui/dashboard/latest-invoices.tsx
5:10 Error: 'LatestInvoice' is defined but never used. @typescript-eslint/no-unused-vars
./app/ui/dashboard/revenue-chart.tsx
4:10 Error: 'Revenue' is defined but never used. @typescript-eslint/no-unused-vars
./app/ui/login-form.tsx
5:3 Error: 'ExclamationCircleIcon' is defined but never used. @typescript-eslint/no-unused-vars
for action.ts error we need to modify and use error param, for example output it to console like this
...
} catch (error) {
console.error('Error ocurred:', error);
return {
message: 'Database Error: Fail create',
}
}
...
for the other errors we need to delete the the definition in each file, because until the end of course, they're never used