microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.31k stars 12.53k forks source link

New error: Type of property 'defaultProps' circularly references itself in mapped type #37597

Open amcasey opened 4 years ago

amcasey commented 4 years ago

https://github.com/nteract/nteract/blob/af734c46893146c617308f4ae1e40bf267e8875f/packages/connected-components/src/header-editor/styled.ts#L24

packages/connected-components/src/header-editor/styled.ts:24:34 - error TS2615: Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof ReactDefaultizedProps<StyledComponentInnerComponent<WithC>, ComponentPropsWithRef<StyledComponentInnerComponent<WithC>>>, StyledComponentInnerAttrs<...> | ... 1 more ... | StyledComponentInnerAttrs<...>> | Exclude<...> | Exclude<...> | Exclude<...>> & Parti...'.

24 export const EditableAuthorTag = styled(AuthorTag)`
                                    ~~~~~~~~~~~~~~~~~

https://github.com/nteract/nteract/blob/af734c46893146c617308f4ae1e40bf267e8875f/packages/presentational-components/src/components/prompt.tsx#L85

Also, I'm seeing each of these errors printed twice.

To repro: 1) yarn 2) tsc -b -f

Note that it fails with a different (apparently unrelated) error in 3.8.

chin2km commented 4 years ago

Any update here? πŸ€”

loolooii commented 4 years ago

Having the same issue using Styled Components with React and TypeScript 3.9.2

theLiudas commented 4 years ago

I'm having this issue aswell. It turns out that something has fucked up with the latest (or one of the latest) release(-s). I managed to resolve this temporarily by simply downgrading TS version to 3.6.5

npm i -D typescript@3.6.5

Should solve the issue πŸ˜„

VladKabantsov commented 4 years ago

Try to use

export const EditableAuthorTag = styled(AuthorTag as any)
kimmikirino commented 4 years ago

Try to use

export const EditableAuthorTag = styled(AuthorTag as any)

Thank you, it worked for me.

lukaskl commented 4 years ago

Not sure if that applies for all of us, but it seems that this error appears using typescript@^3.9.0 (particularly after this PR https://github.com/microsoft/TypeScript/pull/36696).

This breaking change was mitigated by updating @types/styled-components https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42619

However, this fix was deployed at v5.0.1 of @types/styled-components which covers styled-components@^5.0.0 but, nothing has been deployed for earlier versions (e.g. what would cover styled-components@^4.0.0)

So if you are using styled-components@^5.0.0 simply run

yarn upgrade @types/styled-components --latest
# or
npm install @types/styled-components@latest

if you are using styled-components@^4.0.0, well then it is more difficult for now, as in essence @types/styled-components should be updated.

However, as a temporary fix it is possible to remove @types/styled-components from the project, copy styled-components.d.ts file from @types/styled-components@^4.0.0 to your project and make the same fix as in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42619 e.g.:

example content of styled-components.d.ts ```ts // forward declarations declare global { namespace NodeJS { // tslint:disable-next-line:no-empty-interface interface ReadableStream {} } } declare module 'styled-components' { import * as CSS from "csstype"; import * as React from "react"; import * as hoistNonReactStatics from 'hoist-non-react-statics'; export type CSSProperties = CSS.Properties; export type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject }; export interface CSSObject extends CSSProperties, CSSPseudos { [key: string]: CSSObject | string | number | undefined; } export type CSSKeyframes = object & { [key: string]: CSSObject }; export interface ThemeProps { theme: T; } export type ThemedStyledProps = P & ThemeProps; export type StyledProps

= ThemedStyledProps>; // Any prop that has a default prop becomes optional, but its type is unchanged // Undeclared default props are augmented into the resulting allowable attributes // If declared props have indexed properties, ignore default props entirely as keyof gets widened // Wrap in an outer-level conditional type to allow distribution over props that are unions type Defaultize = P extends any ? string extends keyof P ? P : & Pick> & Partial>> & Partial>> : never; type ReactDefaultizedProps = C extends { defaultProps: infer D; } ? Defaultize : P; export type StyledComponentProps< // The Component from whose props are derived C extends keyof JSX.IntrinsicElements | React.ComponentType, // The Theme from the current context T extends object, // The other props added by the template O extends object, // The props that are made optional by .attrs A extends keyof any > = // Distribute O if O is a union type O extends object ? WithOptionalTheme< Omit> & O, A> & Partial & O, A>>, T > & WithChildrenIfReactComponentClass : never; // Because of React typing quirks, when getting props from a React.ComponentClass, // we need to manually add a `children` field. // See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/31945 // and https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32843 type WithChildrenIfReactComponentClass< C extends keyof JSX.IntrinsicElements | React.ComponentType > = C extends React.ComponentClass ? { children?: React.ReactNode } : {}; type StyledComponentPropsWithAs< C extends keyof JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object, A extends keyof any > = StyledComponentProps & { as?: C, forwardedAs?: C }; export type FalseyValue = undefined | null | false; export type Interpolation

= | InterpolationValue | InterpolationFunction

| FlattenInterpolation

; // cannot be made a self-referential interface, breaks WithPropNested // see https://github.com/microsoft/TypeScript/issues/34796 export type FlattenInterpolation

= ReadonlyArray>; export type InterpolationValue = | string | number | FalseyValue | Keyframes | StyledComponentInterpolation | CSSObject; export type SimpleInterpolation = | InterpolationValue | FlattenSimpleInterpolation; export type FlattenSimpleInterpolation = ReadonlyArray; export type InterpolationFunction

= (props: P) => Interpolation

; type Attrs, T> = | ((props: ThemedStyledProps) => A) | A; type DeprecatedAttrs, T> = { [K in keyof A]: ((props: ThemedStyledProps) => A[K]) | A[K] }; export type ThemedGlobalStyledClassProps = WithOptionalTheme & { suppressMultiMountWarning?: boolean; }; export interface GlobalStyleComponent extends React.ComponentClass> {} // remove the call signature from StyledComponent so Interpolation can still infer InterpolationFunction type StyledComponentInterpolation = | Pick< StyledComponentBase, keyof StyledComponentBase > | Pick< StyledComponentBase, keyof StyledComponentBase >; // abuse Pick to strip the call signature from ForwardRefExoticComponent type ForwardRefExoticBase

= Pick< React.ForwardRefExoticComponent

, keyof React.ForwardRefExoticComponent >; // extracts React defaultProps type ReactDefaultProps = C extends { defaultProps: infer D; } ? D : never; // any doesn't count as assignable to never in the extends clause, and we default A to never export type AnyStyledComponent = | StyledComponent | StyledComponent; export type StyledComponent< C extends keyof JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object = {}, A extends keyof any = never > = // the "string" allows this to be used as an object key // I really want to avoid this if possible but it's the only way to use nesting with object styles... string & StyledComponentBase & hoistNonReactStatics.NonReactStatics ? C : never>; export interface StyledComponentBase< C extends keyof JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object = {}, A extends keyof any = never > extends ForwardRefExoticBase> { // add our own fake call signature to implement the polymorphic 'as' prop ( props: StyledComponentProps & { as?: never, forwardedAs?: never } ): React.ReactElement>; = C>( props: StyledComponentPropsWithAs ): React.ReactElement>; withComponent( component: WithC ): StyledComponent< StyledComponentInnerComponent, T, O & StyledComponentInnerOtherProps, A | StyledComponentInnerAttrs >; withComponent< WithC extends keyof JSX.IntrinsicElements | React.ComponentType >( component: WithC ): StyledComponent; } export interface ThemedStyledFunctionBase< C extends keyof JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object = {}, A extends keyof any = never > { (first: TemplateStringsArray): StyledComponent; ( first: | TemplateStringsArray | CSSObject | InterpolationFunction< ThemedStyledProps & O, T> >, ...rest: Array< Interpolation< ThemedStyledProps & O, T> > > ): StyledComponent; ( first: | TemplateStringsArray | CSSObject | InterpolationFunction< ThemedStyledProps & O & U, T> >, ...rest: Array< Interpolation< ThemedStyledProps & O & U, T> > > ): StyledComponent; } export interface ThemedStyledFunction< C extends keyof JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object = {}, A extends keyof any = never > extends ThemedStyledFunctionBase { // Fun thing: 'attrs' can also provide a polymorphic 'as' prop // My head already hurts enough so maybe later... attrs< U, NewA extends Partial & U> & { [others: string]: any; } = {} >( attrs: Attrs & U, NewA, T> ): ThemedStyledFunction; // Only this overload is deprecated // tslint:disable:unified-signatures /** @deprecated Prefer using the new single function style, to be removed in v5 */ attrs< U, NewA extends Partial & U> & { [others: string]: any; } = {} >( attrs: DeprecatedAttrs & U, NewA, T> ): ThemedStyledFunction; // tslint:enable:unified-signatures } export type StyledFunction< C extends keyof JSX.IntrinsicElements | React.ComponentType > = ThemedStyledFunction; type ThemedStyledComponentFactories = { [TTag in keyof JSX.IntrinsicElements]: ThemedStyledFunction }; export type StyledComponentInnerComponent< C extends React.ComponentType > = C extends StyledComponent ? I : C extends StyledComponent ? I : C; export type StyledComponentPropsWithRef< C extends keyof JSX.IntrinsicElements | React.ComponentType > = C extends AnyStyledComponent ? React.ComponentPropsWithRef> : React.ComponentPropsWithRef; export type StyledComponentInnerOtherProps = C extends StyledComponent ? O : C extends StyledComponent ? O : never; export type StyledComponentInnerAttrs< C extends AnyStyledComponent > = C extends StyledComponent ? A : never; export interface ThemedBaseStyledInterface extends ThemedStyledComponentFactories { (component: C): ThemedStyledFunction< StyledComponentInnerComponent, T, StyledComponentInnerOtherProps, StyledComponentInnerAttrs >; >( // unfortunately using a conditional type to validate that it can receive a `theme?: Theme` // causes tests to fail in TS 3.1 component: C ): ThemedStyledFunction; } export type ThemedStyledInterface = ThemedBaseStyledInterface< AnyIfEmpty >; export type StyledInterface = ThemedStyledInterface; export interface BaseThemedCssFunction { ( first: TemplateStringsArray | CSSObject, ...interpolations: SimpleInterpolation[] ): FlattenSimpleInterpolation; ( first: | TemplateStringsArray | CSSObject | InterpolationFunction>, ...interpolations: Array>> ): FlattenInterpolation>;

( first: | TemplateStringsArray | CSSObject | InterpolationFunction>, ...interpolations: Array>> ): FlattenInterpolation>; } export type ThemedCssFunction = BaseThemedCssFunction< AnyIfEmpty >; // Helper type operators type Omit = Pick>; type WithOptionalTheme

= Omit & { theme?: T; }; type AnyIfEmpty = keyof T extends never ? any : T; export interface ThemedStyledComponentsModule< T extends object, U extends object = T > { default: ThemedStyledInterface; css: ThemedCssFunction; // unfortunately keyframes can't interpolate props from the theme keyframes( strings: TemplateStringsArray | CSSKeyframes, ...interpolations: SimpleInterpolation[] ): Keyframes; createGlobalStyle

( first: | TemplateStringsArray | CSSObject | InterpolationFunction>, ...interpolations: Array>> ): GlobalStyleComponent; withTheme: WithThemeFnInterface; ThemeProvider: ThemeProviderComponent; ThemeConsumer: React.Consumer; ThemeContext: React.Context; // This could be made to assert `target is StyledComponent` instead, but that feels not type safe isStyledComponent: typeof isStyledComponent; ServerStyleSheet: typeof ServerStyleSheet; StyleSheetManager: typeof StyleSheetManager; } declare const styled: StyledInterface; export const css: ThemedCssFunction; export type BaseWithThemeFnInterface = < C extends React.ComponentType >( // this check is roundabout because the extends clause above would // not allow any component that accepts _more_ than theme as a prop component: React.ComponentProps extends { theme?: T } ? C : never ) => React.ForwardRefExoticComponent< WithOptionalTheme, T> >; export type WithThemeFnInterface = BaseWithThemeFnInterface< AnyIfEmpty >; export const withTheme: WithThemeFnInterface; /** * This interface can be augmented by users to add types to `styled-components`' default theme * without needing to reexport `ThemedStyledComponentsModule`. */ // Unfortunately, there is no way to write tests for this // as any augmentation will break the tests for the default case (not augmented). // tslint:disable-next-line:no-empty-interface export interface DefaultTheme {} export interface ThemeProviderProps { children?: React.ReactNode; theme: T | ((theme: U) => T); } export type BaseThemeProviderComponent< T extends object, U extends object = T > = React.ComponentClass>; export type ThemeProviderComponent< T extends object, U extends object = T > = BaseThemeProviderComponent, AnyIfEmpty>; export const ThemeProvider: ThemeProviderComponent>; // NOTE: this technically starts as undefined, but allowing undefined is unhelpful when used correctly export const ThemeContext: React.Context>; export const ThemeConsumer: typeof ThemeContext["Consumer"]; export interface Keyframes { getName(): string; } export function keyframes( strings: TemplateStringsArray | CSSKeyframes, ...interpolations: SimpleInterpolation[] ): Keyframes; export function createGlobalStyle

( first: | TemplateStringsArray | CSSObject | InterpolationFunction>, ...interpolations: Array>> ): GlobalStyleComponent; export function isStyledComponent( target: any ): target is StyledComponent; export class ServerStyleSheet { collectStyles( tree: React.ReactNode ): React.ReactElement<{ sheet: ServerStyleSheet }>; getStyleTags(): string; getStyleElement(): Array>; interleaveWithNodeStream( readableStream: NodeJS.ReadableStream ): NodeJS.ReadableStream; readonly instance: this; seal(): void; } type StyleSheetManagerProps = | { sheet: ServerStyleSheet; target?: never; } | { sheet?: never; target: HTMLElement; }; export class StyleSheetManager extends React.Component< StyleSheetManagerProps > {} /** * The CSS prop is not declared by default in the types as it would cause 'css' to be present * on the types of anything that uses styled-components indirectly, even if they do not use the * babel plugin. * * You can load a default declaration by using writing this special import from * a typescript file. This module does not exist in reality, which is why the {} is important: * * ```ts * import {} from 'styled-components/cssprop' * ``` * * Or you can declare your own module augmentation, which allows you to specify the type of Theme: * * ```ts * import { CSSProp } from 'styled-components' * * interface MyTheme {} * * declare module 'react' { * interface Attributes { * css?: CSSProp * } * } * ``` */ // ONLY string literals and inline invocations of css`` are supported, anything else crashes the plugin export type CSSProp> = | string | CSSObject | FlattenInterpolation>; export default styled; } ```

and sorry that I'm posting this still on TypeScript repository, where it seems that DefinitelyTyped repository would be a better fit for this issue πŸ˜…

AdamAnSubtractM commented 4 years ago

Not sure if that applies for all of us, but it seems that this error appears using typescript@^3.9.0 (particularly after this PR #36696).

This breaking change was mitigated by updating @types/styled-components DefinitelyTyped/DefinitelyTyped#42619

However, this fix was deployed at v5.0.1 of @types/styled-components which covers styled-components@^5.0.0 but, nothing has been deployed for earlier versions (e.g. what would cover styled-components@^4.0.0)

So if you are using styled-components@^5.0.0 simply run

yarn upgrade @types/styled-components --latest
# or
npm install @types/styled-components@latest

if you are using styled-components@^4.0.0, well then it is more difficult for now, as in essence @types/styled-components should be updated.

However, as a temporary fix it is possible to remove @types/styled-components from the project, copy styled-components.d.ts file from @types/styled-components@^4.0.0 to your project and make the same fix as in DefinitelyTyped/DefinitelyTyped#42619 e.g.:

example content of styled-components.d.ts and sorry that I'm posting this still on TypeScript repository, where it seems that DefinitelyTyped repository would be a better fit for this issue πŸ˜…

Upgrading the types worked for me. Thank you! πŸ™

sopianguyen commented 4 years ago

Still happening for me.. :'( I'm similarly trying to extend a component like follows:

Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof ReactDefaultizedProps<StyledComponentInnerComponent<WithC>, ComponentPropsWithRef<StyledComponentInnerComponent<WithC>>>, any>> & Partial<...>, any> & { ...; } & WithChildrenIfReactComponentClass<...>>, "defaultProps" | ... 2 more ... | "$$typeof">'.  TS2615

    28 | `;
    29 | 
  > 30 | export const PrimaryButton = styled(Button)`
       |                              ^
    31 |   background-color: ${props => props.theme.primaryColor};
    32 |   border: none;
    33 |   color: ${props => props.theme.textColorOnPrimary};

My relevant packages are "typescript": "^3.6.5", "styled-components": "^5.1.1", "@types/styled-components": "^5.1.0", "@typescript-eslint/eslint-plugin": "^3.1.0", "@typescript-eslint/parser": "^3.1.0",

elertan commented 4 years ago

Still happening for me.. :'( I'm similarly trying to extend a component like follows:

Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof ReactDefaultizedProps<StyledComponentInnerComponent<WithC>, ComponentPropsWithRef<StyledComponentInnerComponent<WithC>>>, any>> & Partial<...>, any> & { ...; } & WithChildrenIfReactComponentClass<...>>, "defaultProps" | ... 2 more ... | "$$typeof">'.  TS2615

    28 | `;
    29 | 
  > 30 | export const PrimaryButton = styled(Button)`
       |                              ^
    31 |   background-color: ${props => props.theme.primaryColor};
    32 |   border: none;
    33 |   color: ${props => props.theme.textColorOnPrimary};

My relevant packages are "typescript": "^3.6.5", "styled-components": "^5.1.1", "@types/styled-components": "^5.1.0", "@typescript-eslint/eslint-plugin": "^3.1.0", "@typescript-eslint/parser": "^3.1.0",

Try removing the ^ from your typescript version to make sure it is actually 3.6.5 and not a higher version

EDIT: I bumped my typescript version to 3.8.3 and afterwards it compiled just fine

Oulander commented 4 years ago

For me this issue was caused by my IDE (VSCode) using a new version of Typescript (3.9.4) to check typings against an old version of Styled Components (4.3.1).

While upgrading both Typescript and Styled Components to the latest versions is probably the best solution, a quick fix that worked for me was to tell VSCode to use the workspace version of Typescript (3.7.5) instead of the latest version.

jermainedebruyne commented 4 years ago

For me this issue was caused by my IDE (VSCode) using a new version of Typescript (3.9.4) to check typings against an old version of Styled Components (4.3.1).

While upgrading both Typescript and Styled Components to the latest versions is probably the best solution, a quick fix that worked for me was to tell VSCode to use the workspace version of Typescript (3.7.5) instead of the latest version.

would be nice to know where you would configure this @Oulander

Oulander commented 4 years ago

would be nice to know where you would configure this @Oulander

@jermainedebruyne In VSCode you can find the version picker either by clicking the version number on the right side of the status bar at the bottom edge of the window, or by using the command palette (see pic). From there, choose "Use Workspace Version" instead of "Use VS Code's Version". image

jermainedebruyne commented 4 years ago

would be nice to know where you would configure this @Oulander

@jermainedebruyne In VSCode you can find the version picker either by clicking the version number on the right side of the status bar at the bottom edge of the window, or by using the command palette (see pic). From there, choose "Use Workspace Version" instead of "Use VS Code's Version". image

Thanks! My problem was that I had 1 VSCode window for multiple repos. Then the version is not simply in the root of one project. Therefore I had to switch to multiple VSCode windows... Not optimal.. I also applied your suggestion πŸ‘

Koolstr commented 4 years ago

This breaking change was mitigated by updating @types/styled-components DefinitelyTyped/DefinitelyTyped#42619 So if you are using styled-components@^5.0.0 simply run npm install @types/styled-components@latest

We didn't have styled-components installed in our project, yet this gave me the idea of updating the similar @types/ packages we are using, and this worked, so thank you. Updating @types/vuelidate to the latest version (0.7.13) fixed it for me, and this is on the latest version of Typescript (3.9.6).

Letting others know that it may not specifically be one of these packages that is giving their error, but possibly some other type-related package, so it's worth experimenting.

bbugh commented 4 years ago

I don't know if it's the same error, but we're having similar sudden circular reference issues in Vue props after trying to upgrade from 3.8.3 to something higher. I bisected all of the releases > 3.8.3 and we tracked down the exact version that breaks: 3.9.0-dev.20200228 (works) -> 3.9.0-dev.20200229 (breaks). These don't seem to be tagged in git so I'm not sure where they come from to compare them.

I wonder if anyone else having this problem can check if these two versions are where your breaking change happened?

mittnavnermike commented 4 years ago

If this helps anyone I identified that my problem was using styled-components-modifiers which called applyStyleModifiers inside the css prop. Removing this got rid of the problem for me.

Cnoor0171 commented 4 years ago

Not sure if anyone else is going to make the same mistake as me, but for me the error was caused by the fact that I missed the return statement in the wrapped component. So, instead of

return (
 <div />
)

I just had

<div />
max-programming commented 3 years ago

Updating typescript and @types/styled-components to the latest version solved the issue for me

NenadJovicic commented 3 years ago

This problem still exist when some interface extends Document from mongoose library, I am on typescript@4.1.3 and mongoose@5.11.11

I have my interface defined like this

import { Document } from 'mongoose';

interface A extends Document {
  someProperty: A,
  ...
}

And then, error is looking like Type of property 'someProperty' circularly references itself in mapped type

stephenh commented 3 years ago

@weswigham / @RyanCavanaugh we're not sure if this is a different issue, but if you need a non-styled-components use case / reproduction for "circularly references itself in mapped type" errors, we have this PR on our open source project:

https://github.com/stephenh/joist-ts/pull/127

That with ~a few lines of change creates errors like:

packages/integration-tests/src/entities/AuthorCodegen.ts:124:29 - error TS2615: Type of property 'book' circularly references itself in mapped type '{ fileName: "fileName"; type: "type"; author: "author"; book: "book"; publisher: "publisher"; }'.

124 export const authorConfig = new ConfigApi<Author, Context>();
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/integration-tests/src/entities/AuthorCodegen.ts:124:29 - error TS2615: Type of property 'book' circularly references itself in mapped type '{ fileName: FieldStatus<string>; type: FieldStatus<ImageType.BookImage> | FieldStatus<ImageType.AuthorImage> | FieldStatus<ImageType.PublisherImage>; author: FieldStatus<...>; book: FieldStatus<...>; publisher: FieldStatus<...>; }'.

124 export const authorConfig = new ConfigApi<Author, Context>();

Understood that isn't as good as a ~10 line standalone repro, but it's what we've got so far... :-/

This "circular references" error has hit us ~2-3 times on changes we've tried to make recently, and we're really not sure how to approach debugging what the cause it or how to fix/avoid it.

We're pretty sure this stems from this Loaded mapped type:

https://github.com/stephenh/joist-ts/blob/main/packages/orm/src/EntityManager.ts#L155

Which lets us make "hint-driven" projections of our entity graph (basically turning tedious/boilerpately "must be async" accesses into "just call .get sync", and given the connectedness of the entity graph (i.e. an author points to the book and the book points to the author), we assume that this is what sends the TS compiler down a rabbit hole of recursion/something/something/we really don't know.

Crizzooo commented 3 years ago

Same issue is happening on all imports from chakra-ui. Basically impossible to use without ts-ignoring every single instance of a component.

../../packages/titan-chakra/src/components/Text.tsx:5:10 - error TS2615: Type of property 'defaultProps' circularly references itself in mapped type 'ForwardRefExoticBase<Omit<Omit<any, any> & Partial<Pick<any, any>>, "theme"> & { theme?: any; } & WithChildrenIfReactComponentClass<StyledComponentInnerComponent<WithC>>>'.

5   return <Text fontSize="sm">hello</Text>;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Any guidance?

nhhockeyplayer commented 2 years ago

seems to be buried in the mongoose generics defs those signatures appear to be klomped on klomp over time

its a matter if reworking your generics <T> and constraint <T extends {id: Types.ObjectId | string | number}> generics signatures and actual call signatures

I could be wrong but thats where I am at modeling my own custom DIY repositories for back end entity mgt

Tomas2D commented 2 years ago

Issue still persist in version 4.6.2 @RyanCavanaugh