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
.next/types/app/patients/[userId]/new-appointment/page.ts:34:29 Type error: Type 'SearchParamProps' does not satisfy the constraint 'PageProps'. Types of property 'params' are incompatible. Type '{ userId: string; } | Promise<{ userId: string; }>' is not assignable to type 'Promise | undefined'. Type '{ userId: string; }' is missing the following properties from type 'Promise': then, catch, finally, [Symbol.toStringTag] 32 | 33 | // Check the prop type of the entry function > 34 | checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>() | ^ 35 | 36 | // Check the arguments and return type of the generateMetadata function 37 | if ('generateMetadata' in entry) { Static worker exited with code: 1 and signal: null
// File: C:\Users\Ganesh\Desktop\HealthCheckup\nxtcheckup\app\patients[userId]\new-appointment\page.tsx
import * as entry from '../../../../../../app/patients/[userId]/new-appointment/page.js'
import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
type TEntry = typeof import('../../../../../../app/patients/[userId]/new-appointment/page.js')
type SegmentParams = T extends Record<string, any>
? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
: T
// Check that the entry is a valid entry
checkFields<Diff<{
default: Function
config?: {}
generateStaticParams?: Function
revalidate?: RevalidateRange | false
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
dynamicParams?: boolean
fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
runtime?: 'nodejs' | 'experimental-edge' | 'edge'
maxDuration?: number
metadata?: any
generateMetadata?: Function
viewport?: any
generateViewport?: Function
experimental_ppr?: boolean
}, TEntry, ''>>()
// Check the prop type of the entry function
checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
// Check the arguments and return type of the generateMetadata function
if ('generateMetadata' in entry) {
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
checkFields<Diff<ResolvingMetadata, SecondArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
}
// Check the arguments and return type of the generateViewport function
if ('generateViewport' in entry) {
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
checkFields<Diff<ResolvingViewport, SecondArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
}
// Check the arguments and return type of the generateStaticParams function
if ('generateStaticParams' in entry) {
checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
checkFields<Diff<{ tag: 'generateStaticParams', return_type: any[] | Promise<any[]> }, { tag: 'generateStaticParams', return_type: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
}
// =============
// Utility types
type RevalidateRange = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
// If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
type FirstArg = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
type SecondArg = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
function checkFields<_ extends { [k in keyof any]: never }>() {}
// https://github.com/sindresorhus/type-fest
type Numeric = number | bigint
type Zero = 0 | 0n
type Negative = T extends Zero ? never : ${T} extends -${string} ? T : never
type NonNegative = T extends Zero ? T : Negative extends never ? T : 'invalid_negative_number'
Type 'SearchParamProps' does not satisfy the constraint 'PageProps'.
Types of property 'params' are incompatible.
Type '{ userId: string; } | Promise<{ userId: string; }>' is not assignable to type 'Promise | undefined'.
Type '{ userId: string; }' is missing the following properties from type 'Promise': then, catch, finally, [Symbol.toStringTag]
The text was updated successfully, but these errors were encountered:
.next/types/app/patients/[userId]/new-appointment/page.ts:34:29 Type error: Type 'SearchParamProps' does not satisfy the constraint 'PageProps'. Types of property 'params' are incompatible. Type '{ userId: string; } | Promise<{ userId: string; }>' is not assignable to type 'Promise | undefined'. Type '{ userId: string; }' is missing the following properties from type 'Promise': then, catch, finally, [Symbol.toStringTag] 32 | 33 | // Check the prop type of the entry function > 34 | checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>() | ^ 35 | 36 | // Check the arguments and return type of the generateMetadata function 37 | if ('generateMetadata' in entry) { Static worker exited with code: 1 and signal: null
// File: C:\Users\Ganesh\Desktop\HealthCheckup\nxtcheckup\app\patients[userId]\new-appointment\page.tsx
import * as entry from '../../../../../../app/patients/[userId]/new-appointment/page.js'
import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
type TEntry = typeof import('../../../../../../app/patients/[userId]/new-appointment/page.js')
type SegmentParams = T extends Record<string, any>
? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
: T
// Check that the entry is a valid entry
checkFields<Diff<{
default: Function
config?: {}
generateStaticParams?: Function
revalidate?: RevalidateRange | false
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
dynamicParams?: boolean
fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
runtime?: 'nodejs' | 'experimental-edge' | 'edge'
maxDuration?: number
metadata?: any
generateMetadata?: Function
viewport?: any
generateViewport?: Function
experimental_ppr?: boolean
}, TEntry, ''>>()
// Check the prop type of the entry function
checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
// Check the arguments and return type of the generateMetadata function
if ('generateMetadata' in entry) {
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
checkFields<Diff<ResolvingMetadata, SecondArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
}
// Check the arguments and return type of the generateViewport function
if ('generateViewport' in entry) {
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
checkFields<Diff<ResolvingViewport, SecondArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
}
// Check the arguments and return type of the generateStaticParams function
if ('generateStaticParams' in entry) {
checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
checkFields<Diff<{ tag: 'generateStaticParams', return_type: any[] | Promise<any[]> }, { tag: 'generateStaticParams', return_type: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
}
export interface PageProps {
params?: Promise
searchParams?: Promise
}
export interface LayoutProps {
children?: React.ReactNode
params?: Promise
}
// =============
// Utility types
type RevalidateRange = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
// If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
type FirstArg = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
type SecondArg = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
function checkFields<_ extends { [k in keyof any]: never }>() {}
// https://github.com/sindresorhus/type-fest
type Numeric = number | bigint
type Zero = 0 | 0n
type Negative = T extends Zero ? never :
${T}
extends-${string}
? T : nevertype NonNegative = T extends Zero ? T : Negative extends never ? T : 'invalid_negative_number'
Type 'SearchParamProps' does not satisfy the constraint 'PageProps'.
Types of property 'params' are incompatible.
Type '{ userId: string; } | Promise<{ userId: string; }>' is not assignable to type 'Promise | undefined'.
Type '{ userId: string; }' is missing the following properties from type 'Promise': then, catch, finally, [Symbol.toStringTag]
The text was updated successfully, but these errors were encountered: