Skip to content

bug: error TS2769: No overload matches this call #4339

@moltar

Description

@moltar

Provide environment information

  System:
    OS: macOS 13.3.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 30.62 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.19.1 - ~/Library/Caches/fnm_multishells/79359_1683625947298/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.19.3 - ~/Library/Caches/fnm_multishells/79359_1683625947298/bin/npm
  Browsers:
    Chrome: 112.0.5615.137
    Firefox: 112.0.2
    Safari: 16.4
  npmPackages:
    @tanstack/react-query: 4.29.5 => 4.29.5 
    @trpc/client: 10.25.0 => 10.25.0 
    @trpc/react-query: 10.25.0 => 10.25.0 
    @trpc/server: 10.25.0 => 10.25.0 
    react: 18.2.0 => 18.2.0 
    typescript: 5.0.4 => 5.0.4 

Describe the bug

Getting a TS build error:

node_modules/@trpc/client/src/links/loggerLink.ts:81:30 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(entries: Iterable<readonly [PropertyKey, any]>): { [k: string]: any; }', gave the following error.
    Argument of type 'Record<string, unknown> & FormData' is not assignable to parameter of type 'Iterable<readonly [PropertyKey, any]>'.
      Property '[Symbol.iterator]' is missing in type 'Record<string, unknown> & FormData' but required in type 'Iterable<readonly [PropertyKey, any]>'.
  Overload 2 of 2, '(entries: Iterable<readonly any[]>): any', gave the following error.
    Argument of type 'Record<string, unknown> & FormData' is not assignable to parameter of type 'Iterable<readonly any[]>'.
      Property '[Symbol.iterator]' is missing in type 'Record<string, unknown> & FormData' but required in type 'Iterable<readonly any[]>'.

81         ? Object.fromEntries(rawInput)
                                ~~~~~~~~

  node_modules/typescript/lib/lib.es2015.iterable.d.ts:49:5
    49     [Symbol.iterator](): Iterator<T>;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    '[Symbol.iterator]' is declared here.
  node_modules/typescript/lib/lib.es2015.iterable.d.ts:49:5
    49     [Symbol.iterator](): Iterator<T>;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    '[Symbol.iterator]' is declared here.

Link to reproduction

N/A

To reproduce

This fails on the internal code and is not reliant on application code. I.e. the error occurs in the types, that come with tRPC.

Additional information

N/A

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR fixing this bug!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions