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

Type instantiation is excessively deep and possibly infinite. #164

Closed
ericchernuka opened this issue Nov 18, 2021 · 2 comments
Closed

Type instantiation is excessively deep and possibly infinite. #164

ericchernuka opened this issue Nov 18, 2021 · 2 comments

Comments

@ericchernuka
Copy link
Contributor

ericchernuka commented Nov 18, 2021

I just added v0.8.0 and ran into a weird issue with the types around the drop function. I've attached a screenshot of the TS error.
My factory is pretty barebones and shown below:

export const dbInstance = factory({
  ingressWorkload: {
    id: primaryKey(faker.datatype.uuid),
    organization: oneOf('organization'),
    state: (): IngressWorkload['state'] => 'Draft',
    name: (): string => 'Untitled',
    notes: nullable(String),
  },
  organization: {
    organizationId: primaryKey(faker.datatype.uuid),
    name: faker.company.companyName,
  },
});

image

I had this working for a bit then it cropped up in CI. We are running TypeScript 4.5.2.

@ericchernuka
Copy link
Contributor Author

Magically went away.

@kettanaito
Copy link
Member

Hey, @ericchernuka. Thanks for reporting this.

With the addition of the nested objects support (#113), our type definitions now reference themselves (the depth of the model may be infinite, in theory). I believe the latest releases of TypeScript can tolerate that just fine. Please note that we support TypeScript 4.2.x at the moment. Recursive types should be possible, otherwise, how can one annotate a recursively nested data structure?

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