Getting error TS5084 @apollo/client@3.7.4

node_modules/@apollo/client/react/hooks/useLoadableQuery.d.ts(11,5): error TS5084: Tuple members must all have names or all not have names.

Hey @sam :wave:

Couple things: Would you mind opening an issue for this? This looks like a bug and I’d like to track this separately. A reproduction of this would be super helpful.

I also wanted to ask, the title suggests you are using Apollo Client 3.7.4, but this hook wasn’t introduced until 3.9.0. Just to clarify, are you sure you’re using the older version of the client?

Hi @jerelmiller
Yes, you are right we just recently moved to v3.9.4. And moving back to 3.7.4 resolved the issue.

Moving back to the older version makes sense since the hook didn’t exist then :slightly_smiling_face:. Would you mind opening an issue in the repo with steps to reproduce? I’d love to get this fixed in a patch release. I haven’t seen this myself, so perhaps there is a TypeScript setting we aren’t accounting for in that hook?

Rather than downgrading, I’d recommend to set skipLibChecks: true in your tsconfig.json while we get this fixes - you don’t need to typecheck all your libraries, and this step will make your IDE a lot faster, too.

I try to update @apollo/client from 3.8.4 to 3.10.2
And I’m getting the same error.

Is the recommendation still to activate skipLibCheck?
Or is there now a solution to the problem?

This has been fixed shortly after it had been reported. Are you sure it’s the same error? Could you share the exact error message?

Yes, sure.

What I did:

nvm use && npm run clean && npm run clobber && npm i

What I get:

node_modules/@apollo/client/react/hooks/useLoadableQuery.d.ts:11:5 - error TS5084: Tuple members must all have names or all not have names.

 11     {
        ~
 12         /**
    ~~~~~~~~~~~
... 
 36         reset: ResetFunction;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 37     }
    ~~~~~

Found 1 error in node_modules/@apollo/client/react/hooks/useLoadableQuery.d.ts:11

Oh dear, I was certain that we fixed this, but it seems like it’s actually still an issue. I opened a PR at Add missing name to tuple member (fix TS5084) by phryneas · Pull Request #11877 · apollographql/apollo-client · GitHub and the next minor should contain a fix.
Meanwhile, yes, skipLibChecks is your best option.

1 Like

Thanks a lot of taking care.