Skip to content

[NewErrors] 4.6.0-dev.20211107 vs 4.4.4 #46721

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

Closed
typescript-bot opened this issue Nov 7, 2021 · 6 comments
Closed

[NewErrors] 4.6.0-dev.20211107 vs 4.4.4 #46721

typescript-bot opened this issue Nov 7, 2021 · 6 comments
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status. Rescheduled This issue was previously scheduled to an earlier milestone

Comments

@typescript-bot
Copy link
Collaborator

The following errors were reported by 4.6.0-dev.20211107, but not by 4.4.4

react-hook-form/react-hook-form

2 of 3 projects failed to build with the old tsc

tsconfig.json

  • error TS2322: Type 'UseFormReturn<FormFieldsBig, object>' is not assignable to type 'Omit<UseFormReturn<FormFieldsSmall, object>, "watch">'.
  • error TS2322: Type 'UseFormRegister<FieldValues>' is not assignable to type 'UseFormRegister<FormValues>'.
  • error TS2345: Argument of type 'UnpackNestedValue<PathValue<TFieldValues, TFieldName>>' is not assignable to parameter of type 'UnpackNestedValue<PathValue<TFieldValues, Path<TFieldValues>>>'.
  • error TS2322: Type 'PathValue<TFieldValues, TName>' is not assignable to type 'UnpackNestedValue<PathValue<TFieldValues, TName>>'.
  • error TS2322: Type 'Partial<FieldArrayWithId<{ [x: string]: ...; }, TFieldArrayName, TKeyName>>[]' is not assignable to type 'Partial<FieldArrayWithId<TFieldValues, TFieldArrayName, TKeyName>>[]'.
  • error TS2322: Type 'Partial<FieldArrayWithId<FieldValues, TFieldArrayName, TKeyName>>[]' is not assignable to type 'Partial<FieldArrayWithId<TFieldValues, TFieldArrayName, TKeyName>>[]'.

statelyai/xstate

5 of 17 projects failed to build with the old tsc

examples/template-svelte-ts/tsconfig.json

examples/todo-mvc-svelte/tsconfig.json

packages/xstate-inspect/tsconfig.json

packages/xstate-test/tsconfig.json

lensapp/lens

4 of 5 projects failed to build with the old tsc

tsconfig.json

@andrewbranch
Copy link
Member

The lens issue is new. The error almost looks correct, except that this assertion is intended to silence it. In 4.4, if you remove the type assertion, you get the same error. In main, the assertion doesn’t silence the error even though it seems like it possibly could or should. This is worth investigating, but should be easy to work around, so I don’t think it’s a major issue for 4.5.

@andrewbranch
Copy link
Member

Self-contained repro:

export class Wizard {

  get steps() {
    const steps = undefined! as { props: { wizard?: Wizard } }[];

    return steps.map(step => {
      const stepProps = step.props;

      return {
        wizard: this,
        ...stepProps,
      } as { wizard?: Wizard };
    });
  }
}

@andrewbranch
Copy link
Member

Also, the issue isn’t currently in release-4.5, so this is something to investigate for 4.6.

@andrewbranch andrewbranch added the Needs Investigation This issue needs a team member to investigate its status. label Nov 8, 2021
@andrewbranch andrewbranch added this to the TypeScript 4.6.0 milestone Nov 8, 2021
@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label May 13, 2022
@rbuckton
Copy link
Contributor

The lens issue was already detected in #46939 as a result of #45729. It looks like @RyanCavanaugh was looking into a solution, but also submitted an upstream fix to lens in lensapp/lens#4480.

@RyanCavanaugh
Copy link
Member

Probably then fixed in #46981

@rbuckton
Copy link
Contributor

The errors in react-hook-form look to be just a change in errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status. Rescheduled This issue was previously scheduled to an earlier milestone
Projects
None yet
Development

No branches or pull requests

4 participants