Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrading to 3.8.0 typescript complains about circular dependencies in models #14

Closed
Amareis opened this issue Dec 6, 2018 · 6 comments

Comments

@Amareis
Copy link

Amareis commented Dec 6, 2018

In 3.7.0 there is no errors

@Amareis
Copy link
Author

Amareis commented Dec 6, 2018

Error:(38, 7) TS7022: 'ItemData' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
Error:(38, 30) TS2345: Argument of type '{ id: ISimpleType<string>; __typename: ISimpleType<string>; notification: ISimpleType<"ON" | "OFF" | "MUTE">; notification_disabled_till: IMaybeNull<ISimpleType<string>>; ... 21 more ...; text: string; }' is not assignable to parameter of type 'ModelPropertiesDeclaration'.
  Property 'creator' is incompatible with index signature.
    Type 'IMaybeNull<IReferenceType<IModelType<ModelPropertiesDeclarationToProperties<{ id: ISimpleType<string>; state: ISimpleType<"ACTIVE" | "PENDING" | "MODERATION">; email: ISimpleType<string>; online: ISimpleType<boolean>; is_my: ISimpleType<boolean>; last_seen: IMaybeNull<...>; profile: IModelType<...>; avatar: IMaybeNu...' is not assignable to type 'string | number | boolean | IAnyType | Date'.
      Type 'IMaybeNull<IReferenceType<IModelType<ModelPropertiesDeclarationToProperties<{ id: ISimpleType<string>; state: ISimpleType<"ACTIVE" | "PENDING" | "MODERATION">; email: ISimpleType<string>; online: ISimpleType<boolean>; is_my: ISimpleType<boolean>; last_seen: IMaybeNull<...>; profile: IModelType<...>; avatar: IMaybeNu...' is not assignable to type 'Date'.

@Amareis Amareis closed this as completed Dec 6, 2018
@Amareis Amareis reopened this Dec 6, 2018
@Amareis
Copy link
Author

Amareis commented Dec 6, 2018

Where creator is just

    creator: types.maybeNull(types.reference(User)),

@Amareis
Copy link
Author

Amareis commented Dec 6, 2018

Oh, or it's mst issue? Not sure now, because User it's classy-mst class, but ItemData is simple mst types.model

@jjrv
Copy link
Member

jjrv commented Dec 13, 2018

Do you have a minimal test case demonstrating the error?

@Amareis
Copy link
Author

Amareis commented Jan 29, 2019

Oh, I caught it. Problems are in mst itself. mobxjs/mobx-state-tree#1157

@jjrv
Copy link
Member

jjrv commented May 7, 2019

I guess this can be closed.

@jjrv jjrv closed this as completed May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants