Search
Get Started
TTC
Theo's Typesafe Cult
•
3y ago
AdmiralGeneralAladeen
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
Theo's Typesafe Cult
Join
26,249
Members
View on Discord
Was this page helpful?
Yes
No
A
AdmiralGeneralAladeen
OP
•
6/19/23, 5:52 PM
this is inside a server component
R
rocawear
•
6/19/23, 5:56 PM
You need to have it async if you do data fetching
R
rocawear
•
6/19/23, 5:57 PM
https://nextjs.org/docs/app/building-your-application/data-fetching/fetching
Data Fetching: Fetching
Learn how to fetch data in your Next
.js application
.
R
rocawear
You need to have it async if you do data fetching
A
AdmiralGeneralAladeen
OP
•
6/19/23, 6:17 PM
it is async
A
AdmiralGeneralAladeen
OP
•
6/19/23, 6:17 PM
the function is async
A
AdmiralGeneralAladeen
OP
•
6/19/23, 6:17 PM
but im not using await within the function anywhere because the fetch helper from the ContentLayer library is synchronous
R
rocawear
•
6/19/23, 6:17 PM
Then you need to await it
A
AdmiralGeneralAladeen
OP
•
6/19/23, 6:18 PM
there are no promises that need to be awaited within the server component though
A
AdmiralGeneralAladeen
OP
•
6/19/23, 6:19 PM
i still want it to be a server component
, I just don
't need to asyncronously fetch any data inside of it
R
rocawear
•
6/19/23, 6:20 PM
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
R
rocawear
Does it help if you remove async from the function then? Hope somebody has done ...
A
AdmiralGeneralAladeen
OP
•
6/19/23, 6:20 PM
No problem
. I tried to remove the async
, but then I get the error that server components need to be async
A
AdmiralGeneralAladeen
OP
•
6/19/23, 6:20 PM
but all of this wouldn
't matter if the eslint rule would just turn off
, idk why it isn
't going off
R
rocawear
•
6/19/23, 6:23 PM
https://github.com/shadcn/taxonomy/blob/main/app/(marketing)/blog/[...slug]/page.tsx
here they do similar thing
, hope it helps
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
R
rocawear
https://github.com/shadcn/taxonomy/blob/main/app/(marketing)/blog/[...slug]/page...
A
AdmiralGeneralAladeen
OP
•
6/19/23, 6:24 PM
thank you
, I didn
't even think to check their eslint file haha
. this is the project I loosely based mien off