Route X has an invalid "GET" export: Type "Y" is not a valid type for the function's second argument. #72373
Unanswered
lancejpollard
asked this question in
Help
Replies: 3 comments 3 replies
-
Using |
Beta Was this translation helpful? Give feedback.
1 reply
-
This fixes it, using import { NextRequest } from 'next/server'
import { handleProviderCallback } from '~/queries/sessions'
type Props = {
params: Promise<{
provider: string
}>
}
export async function GET(request: NextRequest, props: Props) {
const params = await props.params
const searchParams = request.nextUrl.searchParams
const code = searchParams.get('code')
const next = searchParams.get('next') ?? '/'
await handleProviderCallback({
url: request.url,
provider: params.provider,
code,
next,
})
} Still getting this though:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Hi, Yeah, as you have figured out, there are breaking changes in Next 15! So, you have to use the Promise like, params. As per the ESLINT error, does it happen without turbo? Kind of weird, if that's where it fails 🤔 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Here is the code:
It is erroring saying:
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions