You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Argument of type '() => Promise<TypedNextResponseType<string, 400, AnyContentTypeWithAutocompleteForMostCommonOnes>>' is not assignable to parameter of type 'RouteMiddleware<BaseOptions, BaseOptions, unknown, number, AnyContentTypeWithAutocompleteForMostCommonOnes, { ...; }[], void | ... 1 more ... | NextResponse<...>>'.
Type 'Promise<TypedNextResponseType<string, 400, AnyContentTypeWithAutocompleteForMostCommonOnes>>' is not assignable to type 'void | BaseOptions | TypedNextResponseType<string, 400, "application/json"> | NextResponse<string> | Promise<void | BaseOptions | TypedNextResponseType<...> | NextResponse<...>>'.
Type 'Promise<TypedNextResponseType<string, 400, AnyContentTypeWithAutocompleteForMostCommonOnes>>' is not assignable to type 'Promise<void | BaseOptions | TypedNextResponseType<string, 400, "application/json"> | NextResponse<string>>'.
Type 'TypedNextResponseType<string, 400, AnyContentTypeWithAutocompleteForMostCommonOnes>' is not assignable to type 'void | BaseOptions | TypedNextResponseType<string, 400, "application/json"> | NextResponse<string>'.
Type 'TypedNextResponseType<string, 400, AnyContentTypeWithAutocompleteForMostCommonOnes>' is not assignable to type 'TypedNextResponseType<string, 400, "application/json">'.
Type 'AnyContentTypeWithAutocompleteForMostCommonOnes' is not assignable to type '"application/json"'.
Type 'string & Record<never, never>' is not assignable to type '"application/json"'.(2345)
const middlewareFunction: () => Promise<TypedNextResponseType<string, 400, AnyContentTypeWithAutocompleteForMostCommonOnes>>
Doing this works fine:
But doing this:
Gives this error:
I've made a reproducible stackblitz of the issue to demonstrate the issue.
Thanks for such a helpful framework btw!
I've narrowed it down slightly/come up with a workaround. This does work okay:
I've updated the stackblitz to include this third example.
The text was updated successfully, but these errors were encountered: