Can't compile most components

I created a repo(branch) to describe the issue: github link

The error log is too long, and not very useful.

step to produce

  1. clone that repo: git clone --branch atlaskit-typescript-wont-compile --single-branch https://github.com/GongT/issues.git
  2. install dependency: npm i or pnpm i
  3. compile: tsc -p .
example log
node_modules/@atlaskit/button/node_modules/@atlaskit/analytics-next/dist/types/hocs/withAnalyticsContext.d.ts:8:8474 - error TS2344: Type 'Exclude<keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never), keyof D>' does not satisfy the constraint 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)'.
  Type 'keyof (Props & import("/tmp/test-repo/node_modules/@atlaskit/button/node_modules/@atlaskit/analytics-next/dist/types/hocs/withAnalyticsContext").WithContextProps extends any ? (boolean extends (Props & import("/tmp/test-repo/node_modules/@atlaskit/button/node_modules/@atlaskit/analytics-next/dist/types/hocs/withAnal...' is not assignable to type 'keyof (Props & import("/tmp/test-repo/node_modules/@atlaskit/button/node_modules/@atlaskit/analytics-next/dist/types/hocs/withAnalyticsContext").WithContextProps extends any ? (boolean extends (Props & import("/tmp/test-repo/node_modules/@atlaskit/button/node_modules/@atlaskit/analytics-next/dist/types/hocs/withAnal...'. Two different types with this name exist, but they are unrelated.
    Type 'string | number | symbol' is not assignable to type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)'.
      Type 'string' is not assignable to type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)'.
        Type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
          Type 'Exclude<string, keyof D> | Exclude<number, keyof D> | Exclude<symbol, keyof D>' is not assignable to type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)'.
            Type 'Exclude<string, keyof D>' is not assignable to type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)'.
              Type 'string' is not assignable to type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)'.
                Type 'string' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                  Type 'Exclude<string, keyof D>' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                    Type 'Exclude<keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never), keyof D>' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                      Type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                        Type 'string | number | symbol' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                          Type 'string' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                            Type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                              Type 'Exclude<string, keyof D> | Exclude<number, keyof D> | Exclude<symbol, keyof D>' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                Type 'Exclude<string, keyof D>' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                  Type 'string' is not assignable to type 'keyof ((boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<T_1> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                    Type 'string' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                      Type 'Exclude<string, keyof D>' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                        Type 'Exclude<keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never), keyof D>' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                          Type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                            Type 'string | number | symbol' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                              Type 'string' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                Type 'Exclude<string, keyof D> | Exclude<number, keyof D> | Exclude<symbol, keyof D>' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                  Type 'Exclude<string, keyof D>' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                    Type 'string' is not assignable to type '(RequiredKeys<T_1> | Exclude<keyof T_1, RequiredKeys<T_1>>) & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                      Type 'Exclude<string, keyof D>' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>> & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                        Type 'Exclude<keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never), keyof D>' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>> & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                          Type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>> & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                            Type 'string | number | symbol' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>> & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                              Type 'string' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>> & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                                Type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.
                                                                  Type 'string | number | symbol' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.
                                                                    Type 'string' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.
                                                                      Type 'Exclude<string, keyof D> | Exclude<number, keyof D> | Exclude<symbol, keyof D>' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>> & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                                        Type 'Exclude<string, keyof D>' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>> & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                                          Type 'string' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>> & keyof (string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...>)'.
                                                                            Type 'string' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.
                                                                              Type 'Exclude<string, keyof D>' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.
                                                                                Type 'string' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.
                                                                                  Type 'Exclude<keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never), keyof D>' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.
                                                                                    Type 'keyof (Props & WithContextProps extends any ? (boolean extends (Props & WithContextProps extends never ? true : false) ? true : false) extends true ? InferProps<...> : string extends "analyticsContext" | keyof Props ? Props & WithContextProps : Pick<...> & ... 1 more ... & Pick<...> : never)' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.
                                                                                      Type 'string | number | symbol' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.
                                                                                        Type 'string' is not assignable to type 'Exclude<keyof T_1, RequiredKeys<T_1>>'.