Why am I still getting an es-lint error on nextjs build despite turning the rule off?

I've turned the rule off: https://i.vgy.me/wQhYX0.png
10 Replies
AdmiralGeneralAladeen
AdmiralGeneralAladeen•17mo ago
this is inside a server component
rocawear
rocawear•17mo ago
You need to have it async if you do data fetching
AdmiralGeneralAladeen
AdmiralGeneralAladeen•17mo ago
it is async the function is async but im not using await within the function anywhere because the fetch helper from the ContentLayer library is synchronous
rocawear
rocawear•17mo ago
Then you need to await it
AdmiralGeneralAladeen
AdmiralGeneralAladeen•17mo ago
there are no promises that need to be awaited within the server component though i still want it to be a server component, I just don't need to asyncronously fetch any data inside of it
rocawear
rocawear•17mo ago
Does it help if you remove async from the function then? Hope somebody has done the same thing and can help, I have not. Sorry
AdmiralGeneralAladeen
AdmiralGeneralAladeen•17mo ago
No problem. I tried to remove the async, but then I get the error that server components need to be async 😂 but all of this wouldn't matter if the eslint rule would just turn off, idk why it isn't going off
rocawear
rocawear•17mo ago
GitHub
taxonomy/app/(marketing)/blog/[...slug]/page.tsx at main · shadcn/t...
An open source application built using the new router, server components and everything new in Next.js 13. - taxonomy/app/(marketing)/blog/[...slug]/page.tsx at main · shadcn/taxonomy
AdmiralGeneralAladeen
AdmiralGeneralAladeen•17mo ago
thank you, I didn't even think to check their eslint file haha. this is the project I loosely based mien off
Want results from more Discord servers?
Add your server