Next.js Discord

Discord Forum

Unexpected `await` of a non-Promise eslint

Unanswered
Jumbo flying squid posted this in #help-forum
Open in Discord
Avatar
Jumbo flying squidOP
Hey all, working on moving us to next 15. I'm noticing with the new dynamic apis, I'm getting a ton of these errors
Unexpected `await` of a non-Promise
. Is this an eslint issue?

10 Replies

Avatar
Bombay
It's probably related to the fact that [cookies need to be awaited in Next.js 15](https://nextjs.org/blog/next-15#async-request-apis-breaking-change)
Avatar
Jumbo flying squidOP
right so i have it updated like I said, moreso a question why the typing is incorrect on these new dynamic apis
You need to await them
It's a part of the new model
Avatar
Jumbo flying squidOP
I don’t think you read my question. I am AWAITING them. Eslint throws the error because I’m awaiting the new model
likely you are typing it wrong
{
  params: Promise<{ ... }>
}

correct, eslint shouldn't complain.

{
  params: { ... }
}

incorrect, eslint (and a million other things) will complain