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
AdmiralGeneralAladeenOP•2y ago
this is inside a server component
rocawear
rocawear•2y ago
You need to have it async if you do data fetching
AdmiralGeneralAladeen
AdmiralGeneralAladeenOP•2y 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•2y ago
Then you need to await it
AdmiralGeneralAladeen
AdmiralGeneralAladeenOP•2y 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•2y 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
AdmiralGeneralAladeenOP•2y 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•2y 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
AdmiralGeneralAladeenOP•2y 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